Recursive Sum issue!

Hey guys, I've come across this problem, and I'm dying to try to find the answer. I'm quite new to recursion so do give me a break!
"If the user chooses 3. the program will recursively calculate the sum of all integers between 1 and n that are divisible by 3."
Here's what I've come up with so far, but it isn't working. I'm confident that it's easy to do, but I'm just a 'noob' at it.
int recSum(int n)
     if(n == 0)
          return 0;
     else if (n == 3)
          return 3;
     for (int i = 0; i < n+1; i++)
          if (i%3 == 0)
               temp = i + recSum(n-1);
     return temp;
}I'd appreciate it if I could get a little bit of help!

Since this appears to be an exercise, I'm not going to give you the actual code. However, I will say that your beginning is OK. You are messing up at the end, especially with the for loop. Let the recursion do the work for you. If n is divisible by 3, then the answer is n + recSum(n-1). Or, you can speed things up slightly and do n + recSum(n-3). However, if n is not divisible by 3, then the answer is just recSum(n-1).

Similar Messages

  • Group Header/Footer Sum Issue

    Hey all,
    I have an issue which I thought I had covered, but I need a more solid solution.
    SO, I am making a query to do with AR Invoices by the row level, but I want to be able to sum at the header level to use the PaidToDate field so I know how much is left to pay on the document.
    So it is just DocTotal - PaidToDate.
    Problem is, I need to be able to see the items from the document.  So I have it right down to the row level using INV1.
    So now when I group by the DocNum field everything looks fine, but when I go to see what is left I calculate using DocTotal - PaidToDate.
    Problem is, because I'm at the row level it gives me the owing amount for each line like below.
    DocNum    CardName  DocTotal   PaidToDate   LineNum     Qty    Price   Description   
    1234          SAP             $100          $50                0              3       $25      Stick
    1234          SAP             $100          $50                1              1       $25      Puck
    So in this example you can see that SAP has an invoice # 1234 for $100 and they have paid $50 but because of the way it is organized the $50 is paid only on the OINV header level, but is linked to the rows, so it will SUM to $100 paid when it's only $50 paid on the document.
    This isn't such a huge issue because I did an IF statement: IF {INV1.LineNum} = 0 THEN ({OINV.DocTotal} - {OINV.PaidToDate}) ELSE 0.
    BUT, in this case it is a bit more complicated because I am using Enprise and I am pulling lines by project so the lines pulled from an invoice might be taken from the middle of a document.  I would be fine if the first line was always LineNum = 0, but some of the times it is not.
    Is there a better programmatic way to handle this?  Rather than a clunky IF statement?
    Thanks!
    Mike

    Hi Yogesh,<br /><br />
    Thanks for your comments. You've raised several valid points, which I'll address below.<br /><br />
    In the past 18 months, Enprise Job Costing has undergone fairly significant improvement and feature enhancement. It's fair to say that forward development and product improvement is where we've placed greatest resource emphasis. We're continuing to improve the product set and plan to introduce significant new features over the next 9 - 12 months. If you'd like to see a copy of our planned development road map, I'll be happy to share that with you.<br /><br />
    The documentation for Enprise Job Costing, while currently somewhat out of date, is currently being rewritten. We will be releasing new chapters for the documentation as they become complete and expect to have the entire documentation suite completed within the next 2-3 months. <br /><br />
    In the short term, your SAP implementation partner will be able to provide access to each new chapter as it becomes available, as we'll post them to our partner support website. <br /><br />
    Longer term, we will be opening portions of our support site up for end user access, so that people with technical skill, like yourself, can self-help to a degree. We already have a plan to introduce a community/forum where interested people can ask questions and share ideas. Such a forum existed a few years back, through SAP's P2P network, but we found that it wasn't well utilised and I don't believe it is a current feature of the revised network.<br /><br />
    Our new forum will be delivered through a new iteration of our partner support website. We've designed the new site map for this tool, which includes such new functionality. Actual development will begin shortly. We will also be introducing a customer (end-user) focused newsletter to supplement the one we distribute through the partner community. The customer focused version will have more in the way of 'tips n tricks' type content and will likely be very product/road map focused.<br /><br />
    In the meantime, I encourage you to follow our various social media activities. We provide regular product update snippets through our LinkedIn profiles, through our Twitter accounts and through our Facebook page. In fact, I'd love it if you would begin using our Facebook page as a precursor to a customer oriented forum and encourage any and all communication.<br /><br />
    Our various social media profiles can be found here:<br />
    - Facebook: [http://www.facebook.com/pages/Enprise-Software/129716737045362]<br />
    - Twitter: [http://www.twitter.com/enprise], [http://www.twitter.com/enprisesoftware], [http://www.twitter.com/enprisesupport], [http://www.twitter.com/enpriseproducts]<br />
    - LinkedIn: [http://www.linkedin.com/companies/enprise-software].<br /><br />
    Please also feel free to follow me personally on LinkedIn. I make regular posts, which many of our partners find useful. You can find my profile here: [http://nz.linkedin.com/in/jasondlangley]<br /><br />
    I'll call you shortly to discuss this topic in more detail.<br /><br />
    Best regards,<br /><br />
    Jason Langley<br />
    General Manager<br />
    Enprise Software<br /><br />

  • SUM issue with XSS components during maintenance on NDWI controlled landscape

    Hello,
    This is our first time using SUM/MOpz for a release upgrade procedure as the last JSPM update disabled the launch program.
    During our test upgrade of our Enterprise Portal HUB landscape (source NW 7.02 -> target NW 7.4) with EHP5 for ERP 6.0 - XSS Self Services for backend ERP system installed. I've encountered an issue with SUM in the Configuration stage - Target Release Components screen. the only 5 objects SUM cannot handle automatically are the XSS Self Services target release components:
    SAPPCUI_GP         633
    SAP_ESS               633
    SAP_ESS_LGP     633
    SAP_MSS               630
    UTXSSLGP             633
    The only option I have is to scan inbox to rebuild the component list. I'm assuming, since these components are being modified by us and delivered/deployed thru NWDI track, their source location on the system is now the track name instead of the SAP delivered MAIN_ERP53VAL_C. Which means that SUM is expecting updated modified SCAs from NWDI for new 633 versions in the download directory before proceeding to next phase. However, in NWDI landscape configurator for this track, I have checked the option to mark system in NWDI control and verified SUM recognizes the system as NWDI controlled.
    I'm struggling to understand the where the disconnect is between SUM and NWDI for theses components as I thought that SUM is supposed to ignore the DEV NWDI developed and wait for updates modified SCAs only in QA and PROD. Does anyone else have experience with this process to help me?
    Regards,
    Paul

    Hi Paul,
    We are facing the same issue although we can see in the process Overview of SUM that the system is not ticked as under NWDI Control.
    But we are facing problem only for SAP ESS and SAP MSS not other components. Other three components are coming up fine and ready for deployment. This is due to the issue that only these components are identified in the BUILD COMPONENT LIST UPGRADE step as modified.
    Detailed checking of the logs led us to errors identical to the KBA 2034886 - Error: Dialog eliminator ConfirmComponentsDialogEliminator does not allow to omit dialog ConfirmComponents
    The system should get picked as under NWDI control and following all steps of the upgrade for NWDI driven system landscapes
    Thanks and Regards,
    Karan Shah
    Message was edited by: Karan Shah

  • Recursive BOM - issue

    Hi,
    This is actually a bit Techno-functional type issue we have here.
    There is a material having a recursive BOM. That means when it explodes it explodes into the same material.
    So in Sales Order
    item 10 - Material X
    generates item 20 - material X.
    After the GR is done as expected on Material X but in Item 20.
    Till this part everything is fine.
    Now we create the billing document. It should actually pick up Item 10 but instead it picks up item 20. Can you tell me any configuration / routines which can be done to avoid this issue.
    We have the billing documnet which is referencing the Order and not the delivery.
    Any suggestions would be very useful.
    Thanks and Regards,
    Arnab.
    Edited by: Arnab Panigrahi on Jul 2, 2008 3:10 PM

    Dear All,
    I am having similar issue, Can any one help me in this regard.
    As per my client requirement:
    For Ex:
    Scenario 1:
    To produce 100 kg of A, 102 kg of A is used.
    Due to Market return stock 2 KG will processing loss or indivisible to loss.
    As per business policy i can't change these BOM Header & Item Quantities.
    The system cannot cost material A and issues an error message.
    Scenario 2:
    To Produce 100 Kgs of A Material(FG), We need B Material 98 KG(SFG).
    Product is ready and despatched to Market.
    After Some time Few Stocks will come as Market retunrs in FG Stage(A).
    We need to Re-Process the same and stock will converted to SFG(B).
    During this case also i am getting Recursive BOM errors.
    Due to in A Material BOM ,B is a component already-Costing run Completed sent to Market. Now I am Converting the stock of A to B through a Production order while maintaining A as Component for B Material BOM.
    Every stage i have alternative BOMs.
    As per the requirement i can't avoid, Please suggest is there other user exits or Message control or Process to resolve the same.
    Regards
    Manoj Kumar Pedada
    SAP CO Consultant

  • At new - sum issue.

    Dear all ,
    My problem is at  'at new' statement ,sum is not working.Please tell me where i am wrong.
    REPORT  Z_AUTOMATED_PO.
    DATA : BEGIN OF IT_STORE_PO OCCURS 0,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MENGE LIKE EKPO-MENGE ,
           menge_i type i,
           MATNR LIKE EKPO-MATNR,
           END OF IT_STORE_PO.
    SELECT ebeln ebelp MATNR MENGE FROM EKPO
       INTO CORRESPONDING FIELDS OF TABLE IT_STORE_PO
          WHERE ELIKZ NE 'X' AND  WERKS = 'E001'.
    sort IT_STORE_PO by matnr.
    LOOP AT IT_STORE_PO.
    at end of matnr.
    sum.
    write :/ it_store_po-matnr,it_store_po-menge.
    endat.
    ENDLOOP.
    Thank you all.

    Hi,
    Please mdoify code as below:
    data:
    v_index type sy-index,
    v_menge type mara-menge.
    sort IT_STORE_PO by matnr.
    LOOP AT IT_STORE_PO.
    v_index = sy-tabix.
    at end of matnr.
    sum.
    v_menge = it_store_po-menge.
    read table it_store index v_index.
    write :/ it_store_po-matnr,v_menge.
    clear: v_index, v_menge.
    endat.
    ENDLOOP.
    Since when SUM. is triggered all the numeric values are summed up and non numeric values are made *****.
    So I used a READ statement.
    Thanks & Regards,
    Navneeth k.

  • SUM issue at phase specify Credentials on PI7.4 dual STACK

    Hello SAP,
    We are planning to apply SFTP addon using SUM .
    We are getting error at phase - specify Credentials
    Pls check the below error log.
    An error has occurred during the execution of the Determine system release step.
    You can find more information in the file
    To troubleshoot the problem use the provided information. An SAP Note may provide a solution to this problem. Search for SAP Notes with the following keywords:
    DETECT  input_credentials  input-credentials-dialog  determine-engine-release  com.sap.sdt.j2ee.services.servicesimpl.EngineInfoService  class com.sap.sdt.j2ee.tools.releasedetection.EngineReleaseDetectionException
    VERSION_ACTION_VERSION_NULL_16.ERR:
    /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh[10]: /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/launcher.sh: cannot execute
    TroubleTicket_16.txt:
    Trouble Ticket Report
    Update to n/a
    SID................: n/a
    Hostname...........: n/a
    Install directory..: /usr/sap/SID
    SUM directory......: /SUM/sdt
    Database...........: n/a
    Operating System...: UNX
    JDK version........: 1.6.0_81 SAP AG
    SUM version........: 1.0.11.1
    Source release.....: n/a
    Target release.....: n/a
    ABAP stack present.: true
    An error has occurred during the execution of the Determine system release step with action input_credentials. Service com.sap.sdt.j2ee.services.servicesimpl.EngineInfoService failed with the following message:
    Could not detect AS Java release.
    You can find more information in the files /SUM/sdt/log/SUM/DETERMINE-ENGINE-RELEASE_16.LOG and ProcessOverview.html.
    Use the information provided to trouble-shoot the problem. There might be an OSS note providing a solution to this problem. Search for OSS notes with the following search terms:
    DETECT,input_credentials,input-credentials-dialog,determine-engine-release,com.sap.sdt.j2ee.services.servicesimpl.EngineInfoService,class com.sap.sdt.j2ee.tools.releasedetection.EngineReleaseDetectionException
    DETERMINE-ENGINE-RELEASE_16.LOG:
    <!--LOGHEADER[START]/-->
    <!--HELP[Manual modification of the header may cause parsing problem!]/-->
    <!--LOGGINGVERSION[2.0.7.1006]/-->
    <!--NAME[/SUM/sdt/log/SUM/DETERMINE-ENGINE-RELEASE_16.LOG]/-->
    <!--PATTERN[DETERMINE-ENGINE-RELEASE_16.LOG]/-->
    <!--FORMATTER[com.sap.tc.logging.TraceFormatter(%d [%6s]: %m)]/-->
    <!--ENCODING[UTF8]/-->
    <!--LOGHEADER[END]/-->
    Jul 31, 2014 12:18:05 AM [Info  ]: Checking AS Java release using version command.
    Jul 31, 2014 12:18:05 AM [Info  ]: The tool have been found in location /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh.
    Jul 31, 2014 12:18:05 AM [Info  ]: Process ID 339, name /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh has been started.
    Jul 31, 2014 12:18:05 AM [Info  ]:   Command line: /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh
    Jul 31, 2014 12:18:05 AM [Info  ]:   Standard out: /SUM/sdt/log/SUM/VERSION_ACTION_VERSION_NULL_16.OUT
    Jul 31, 2014 12:18:05 AM [Info  ]: Process ID 339 has been started.
    Jul 31, 2014 12:18:05 AM [Info  ]: Waiting for process ID 339, name /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh to finish.
    Jul 31, 2014 12:18:05 AM [Info  ]: Process ID 339, name /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh has been finished, exit code 126.
    Jul 31, 2014 12:18:05 AM [Error ]: The following problem has occurred during step execution: com.sap.sdt.j2ee.tools.releasedetection.EngineReleaseDetectionException: Could not detect AS Java release.
    Return code condition success evaluated to false for process /usr/sap/SID/DVEBMGS00/j2ee/cluster/bootstrap/scripts/version.sh for action ACTION_VERSION.

    This is part one from the above note:
    I. Change configuration for web methods protection to DEFAULT and restart:
    1. Open for edit DEAFULT.PLF file from /usr/sap/(SID)/SYS/profile and set configuration:
    service/protectedwebmethods = DEFAULT
    2. Restart the cluster including sapstartsrv OS service:
    2.1. For windows you can execute with administrator privileges following command to stop the services:
    c:\> sc stop SAP[SID]_[Instance_Number]
    c:\> sc stop SAP[SID]_[SCS_Instance_Number]
    c:\> sc start SAP[SID]_[SCS_Instance_Number]
    c:\> sc start SAP[SID]_[Instance_Number]
    (SAP MMC could automatically start the services, in this case start command will produce warning "An instance of the service is already running.")
    2.2. For Linux/Unix you can use stopsap/startsap commands without parameters (more info is available here : http://help.sap.com/saphelp_nwpi71/helpdata/en/47/1d6feeff6e0d46e10000000a155369/content.htm).
    3. Retry update procedure step.
    4. After upgrade has finished you can restore the settings in the DEFAULT.PFL profile and restart the instance and services
    .Set service/protectedwebmethods = DEFAULT in default profile
    stopsap -i DVEBMGS<nn>
    stopsap -i SCS<nn>
    startsap -i SCS<nn>
    startsap -i DVEBMGS<nn>
    where <nn> is your instance number
    Retry failed step again.
    Divyanshu

  • How to Recursively Sum a Sum?

    Sorry, everyone, this is driving me nuts.  I have the following query, which gives me the relative percentage of [INDEX MARKET CAP].
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() as [%]
    FROM [S&P_Emerging_SmallCap_(US_Dollar)]
    So, I get a sum of the [INDEX MARKET CAP], and then find the relative percentage of each items in the INDEX MARKET CAP.  Great!  now, I'm trying to modify the query a bit to give me the SUM of each relative INDEX MARKET CAP.  So, the sum will
    be 100%!  I just want to prove that the query works.
    I'm trying to follow the example here.
    http://technet.microsoft.com/en-us/library/ms190766%28v=sql.105%29.aspx
    It seems so simple, but this dang thing just won't work.
    I think it should be something like this.
    ;With CTE (Company, [%])
    AS
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() as [%]
    FROM [S&P_Emerging_SmallCap_(US_Dollar)]
    Select Company, SUM([%]) as Total
    FROM CTE
    Group By Company, Total
    I keep getting this.
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'SELECT'.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. The garbage you
    posted has spaces in it! That means that you cannot use those names in any ISO standard programming. You are an 1950's COBOL Programmer who does not understand tiered architectures, so he writes headers for display instead of having a presentation layer. In
    fact, you are even worse with all that meta-data garbage in your data elements. USD is a unit of measurement on a scale, not part of a data element name. Is there any way you can get a book or course in basic data modeling?? 
    Why do you think that “company” is a clear, precise data element name that is an industry standard? It is not! This generic, vague and useless. I would guess that you are using a ticker symbol or a DUNS as the identifier. But it might be “company_<anything>”
    or worse. What is that generic “total”? Why did you destroy any hope of a data dictionary with crap like [%]?? First of all, we use double quotes in ANSI/ISO Standard SQL, so this disaster should have been “%” without the brackets. Why do you think you can
    use that  one character name anywhere else? What language? The best it could be is "generic_percentage", so that programmers that follow you will know it is crap. Pros write code for the maintenance guys that have not been hired yet, not for personal
    spreadsheet use. 
    50 years ago when you were writing COBOL, there was a hierarchical record structure. In RDBMS, rows are not records and columns are not fields. The fields (attributes) are drawn from domains of scalar values. The names exist in those domains. Your automobile
    is a VIN everywhere in the universe! It is not local. 
    Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> Sorry, everyone, this is driving me nuts. I have the following query, which gives me the relative percentage of [INDEX MARKET CAP].
    SELECT *, [INDEX MARKET CAP] * 100/SUM([INDEX MARKET CAP]) OVER() AS "generic_percentage" FROM [S&P_Emerging_SmallCap_(US_Dollar)] <<
    >> So, I get a sum of the [INDEX MARKET CAP], and then find the relative percentage of each items in the INDEX MARKET CAP.  Great!  now, I'm trying to modify the query a bit to give me the SUM of each relative INDEX MARKET CAP. So, the sum will
    be 100%! <<
    No, it will not. In fact, you will be lucky to get 99.99% -- do you understand rounding errors? Since you were rude (really, really rude by SQL Forum standard, in fact)  We have no idea what data types we have here; we have to guess you used DECIMAL(s,p)
    so you might get better answers with “index_market_cap * 100.0000 /SUM(index_ market_cap) OVER() AS index_market_cap_percentage”; See the decimal places? Unlike spreadsheet, we have to worry about this in SQL. 
    As far as your error goes, look at the CTE column list and the GROUP BY; they do not match ! 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Recursive tree issue

    Hello!
    I have made a view object with self referencing view link, dropped the data control onto page, added a rule, chosen attributes.
    It works fine, but the tree initially displays all the table rows, since the tree uses a single view object and query is not limiting the data because if i limit it for selecting only root records, the children won't be seen, of course. How to construct a recursive tree, so that it would initially have only root records on top?
    Thank you!

    This is in 11.1.1.4 btw.
    Here's the stack trace if it helps:
    java.lang.IllegalStateException: ADF_FACES-60025:Error trying to change index from: 0 to: 1 rowCount: 2.
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:171)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils$1.setRowIndex(TreeRendererUtils.java:568)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.renderDataBlockRows(TableRenderer.java:1860)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:613)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeTableRenderer.encodeAll(TreeTableRenderer.java:600)
    Caused by: java.lang.IllegalStateException: ADFv: Not inside a container.
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.exitContainer(FacesCtrlHierBinding.java:673)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollForward(FlattenedTreeCollectionModel.java:260)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollIndex(FlattenedTreeCollectionModel.java:221)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollRepeatedly(FlattenedTreeCollectionModel.java:190)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollFromTop(FlattenedTreeCollectionModel.java:183)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:152)
    We have a copy of the adf 11.1.1.4 source and I checked FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:171) but it doesn't reveal anything. I see the part that rethrows the IllegalStateException, e.g.:
    try
    //more code here
    catch (IllegalStateException e)
    IllegalStateException exp =
    new IllegalStateException(LoggerUtils.getMessage(
    LOG, LoggerBundle.EXCCHANGE_INDEX, new Object[]{_index,index,_rowCount}));
    exp.initCause(e);
    throw exp;
    But I can't find the part that actually throws the IllegalStateException. I'm looking for an explanation as to why this is happening. I understand the solutions above worked for some people but there never was an explanation about what the error is about (e.g. why did the exception happen). The error message is far too cryptic and does not really establish what could be wrong which is just annoying as hell.

  • Webi report sum issues

    Hi All,
    I have a webi report with the fields as below and at the bottom of the report, I am trying to sum the amount it gives me multivalue or double the number.
    Status
    Amount
    ID NUmber
    Description
    Station
    A
    3,037.44
    578
    Light
    X157
    E
    3,899.68
    579
    Light
    X157
    Sum of Amount
    #MULTIVALUE
    For sum of amount I am using formula as: =(If([Status Id]="E" ;Sum([Payment Amount]);0)) this gives a multivalue error. If I use formula as :
    =Sum(If([Status Id]="E" ;Sum([Payment Amount]);0)); this gives number as 69,371.2. I am expecting to see 3899.68 since that is the number for Status=E.
    If I use =Max(If([Status Id]="E" ;Sum([Payment Amount]);0)) it gives the number as 6937.12 which is sum of both the 3037.44 and 3899.68, which is incorrect.
    Please help where I am going wrong.
    Thanks,
    Nisha

    Thanks for your quick response.
    I am using merge dimensions. I am merging ID Number and station. Query 1 I have all the fields, query 2 I have ID number, Station and Amount. So I am merging the 2 fields.

  • Rollup and having sum issue

    Hello friends, I am hoping you can help with me this simple query. Basically using rollup to get subtotals. But I need to include subtotals that add up to >10,000:
    select a.column1
    ,nvl(to_char(m3.column2),DECODE(a.column1,null,null,'SubTotal')) somevalue
    ,c.column3 column3
    ,c.column4 column4
    ,c.column5 column5
    ,to_char(sum(round(m4.column5/100,2)),'$99,999,999.99') column6
    from table1 a,table2 c,table3 m2,table4 m3,table5 m4
    where
    a.someid=c.someid
    and a.someid=m2.someid
    and m2.someid=m3.someID
    and m3.someID=m4.someID
    and m3.somedate > sysdate -7
    group by (a.column1,c.column3,c.column4,c.column5),rollup (m3.column2)
    having sum(round(m4.column5/100,2))>10000 -- Looks like I need to specify this before the rollup but
    So I get this with the "having sum" :
    123456     SubTotal     123456789     Some Company LLC     $15,630.00
    But I want:
    12456     123546          123456789          Some Company, LLC     $5,000.00
    12456     512121          123456789          Some Company, LLC     $7,000.00
    12456     346545          123456789          Some Company, LLC     $125.00
    12456     843131          123456789          Some Company, LLC     $5.00
    12456     SubTotal     123456789          Some Company, LLC     $15,630.00

    Hi,
    Welcome to the forum!
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the problem as much as possible. Remove all tables and columns that play no role in this problem.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    The HAVING clause deals with groups; you're not concerned with the amount in each group, but the rolled up amount of several related groups put together.
    One way to do what you want is to use the analytic SUM function to get the total. Analytic functions are applied after aggregate functions, so you can use the aggregate SUM to get a sum of sums.
    Here's an example using the scott.emp table. Say we want to show employees and their salaries, with a sub-total for each employee, and the total for each department, but we only want toi include departments where the total is over 9000. Here's how:
    WITH     got_total     AS
         SELECT       deptno
         ,       ename
         ,       SUM (sal)     AS total_sal
         ,       SUM (SUM (sal)) OVER (PARTITION BY deptno) / 2     -- See note
                                 AS a_total_sal
         FROM       scott.emp
         GROUP BY  deptno
         ,            ROLLUP (ename)
    SELECT       deptno
    ,       ename
    ,       total_sal
    FROM       got_total
    WHERE       a_total_sal     > 9000
    ORDER BY  deptno
    ,            ename
    ;Output:
    `   DEPTNO ENAME       TOTAL_SAL
            20 ADAMS            1100
            20 FORD             3000
            20 JONES            2975
            20 SCOTT            3000
            20 SMITH             800
            20                 10875
            30 ALLEN            1600
            30 BLAKE            2850
            30 JAMES             950
            30 MARTIN           1250
            30 TURNER           1500
            30 WARD             1250
            30                  9400Notice that deptno=10 is not included.
    Since we're using the analytic clause "PARTITION BY deptno", the analytic SUM will be the total of all rows in the result set that have the same deptno. That include the Super-Aggregate row that we get by using ROLLUP, so the amount returned will actually be double the total salary in the department. That is, the total for deptno=20 will include the individual salaries 1100, 3000, and so on, plus the super-aggregate total of 10875, so the numebr returned by the analytic SUM function will be twice the actual total. That's why I include "/ 2" in the query above.
    Edited by: Frank Kulash on May 15, 2012 10:18 AM

  • SUM issue in Internal table

    Hi All,
    I have an internal table as follows.
    Now if the KUNNR, PRCTR and VERNA field are similar, i have to sum up the QTY columns accordingly.
    I mean to say, in this case, the rows 1, 2 and 3 have same kunnr, prctr and verna fields. Henc ei should sum up the corresponding columns (qty1, qty2, qty3 and SUM) and make it as one row.
    kunnr  |    prctr    |   verna  |   qty1  |  qty2  |    qty3  |  sum
    11       |    100      |  Raj     | 10.0   |  5.0     |   0.0    |  15.0
    11       |   100       |  Raj     | 8.0     |  1.0     |   2.0    |  11.0
    11       |    100      |  Raj     | 0.0     |  0.0     |   6.5    |  6.5
    12       |    200      |  Ram   | 2.0     |  0.0     |   0.0    |  2.0
    How to carry out this calculation....???
    Regards
    Pavan

    Hi Friend,
               Use the Control Break Statement for this,  Go through the following steps
    1.     Sort  the Internal Table
    2.     Loop the Internal Table
    3.     Use the Control Break Statement
    4.     Sum
    5.    Write Statement
    6.     Endloop.                                      
    Ex.
    sort itab.
    loop at itab.
       at end of kunnr.
               sum.
      write:  'mara-kunnr'.
    endat.
    endloop.
    Hope the answer of your question.
    Regards,
    Md Ziauddin.
    Edited by: MD ZIAUDDIN on Dec 31, 2008 7:40 PM

  • Java Recursively sum up the Excel column values

    I have a requirement to perform some calculations using java taking inputs from Excel file.
    My Excel file content is as follows:
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     900.00
    Row[16] ECOUT ACTUAL VALUE     900.00
    Row[17] RESULTS     PASS
    To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
    import java.io.*;
    import org.apache.poi.ss.usermodel.Cell;
    import org.apache.poi.ss.usermodel.Row;
    import org.apache.poi.ss.usermodel.Sheet;
    import org.apache.poi.ss.usermodel.Workbook;
    import org.apache.poi.ss.usermodel.WorkbookFactory;
    public class ReadXlsxXls
    public static void main(String[] args) throws Exception, FileNotFoundException, IOException
              try
         Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
         Sheet sheet = workbook.getSheet("ROLLUPS - Results");
         double summ = 0;
         double sub = 0;
         double result=0;
         for (int i = 0; i < sheet.getLastRowNum(); i++)
              Row row = sheet.getRow(i);
         Cell cell1 = row.getCell(0);
         Cell cell2 = row.getCell(1);
         if (cell1 != null && cell2 != null)
         String cellValue1 = cell1.getStringCellValue();
         String cellValue2 = cell2.getStringCellValue();
         if(cellValue2.contains("="))
         String stringNumber = cellValue2.split("=")[1].trim();
         if (cellValue1.contains("ADD"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         summ = getSumm(summ, stringNumber);
         else if (cellValue1.contains("SUB"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         sub = getSubstraction(sub, stringNumber);
         /* else
         System.out.println("Smt wrong");
         System.out.println("ADD = " + summ);
         System.out.println("SUB = " + sub);
         result=summ-sub;
         System.out.println("RESULT = " result"0");
         catch(NullPointerException e)
              e.printStackTrace();
         catch(Exception e)
              e.printStackTrace();
         private static double getSubstraction(double main, String your)
         if (your.contains("-"))
         return main + Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main - Double.parseDouble(your.replace("+", ""));
         else
         return main - Double.parseDouble(your);
         private static double getSumm(double main, String your)
         if (your.contains("-"))
         return main - Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main + Double.parseDouble(your.replace("+", ""));
         else
         return main + Double.parseDouble(your);
    Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
    column(o) column(1)
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     | 900.00
    Row[16] ECOUT ACTUAL VALUE     | 900.00
    Row[17] RESULTS     | PASS
    Row[18]
    Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
    Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
    Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
    Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
    Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
    Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
    Row[25] ECIN - INPUT VALUE (ADD)
    Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
    Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
    Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
    Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
    Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
    Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
    Row[32] ECIN - INPUT VALUE (SUB)     
    Row[33]
    Row[34] ECOUT EXPECTED VALUE     | 440.00
    Row[35] ECOUT ACTUAL VALUE     | 320.00
    Row[36] RESULTS     | FAIL
    Row[37]
    Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
    Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
    Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
    Row[41] ECIN - INPUT VALUE (ADD)
    Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
    Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
    Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
    Row[45] ECIN - INPUT VALUE (SUB)     
    Row[46]
    Row[47] ECOUT EXPECTED VALUE     | 640.00
    Row[48] ECOUT ACTUAL VALUE     | 720.00
    Row[49] RESULTS     | FAIL
    I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
    If my requirement is not clear, please let me know. Thank you.
    Edited by: 1002444 on Apr 25, 2013 11:20 PM

    I have a requirement to perform some calculations using java taking inputs from Excel file.
    My Excel file content is as follows:
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     900.00
    Row[16] ECOUT ACTUAL VALUE     900.00
    Row[17] RESULTS     PASS
    To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
    import java.io.*;
    import org.apache.poi.ss.usermodel.Cell;
    import org.apache.poi.ss.usermodel.Row;
    import org.apache.poi.ss.usermodel.Sheet;
    import org.apache.poi.ss.usermodel.Workbook;
    import org.apache.poi.ss.usermodel.WorkbookFactory;
    public class ReadXlsxXls
    public static void main(String[] args) throws Exception, FileNotFoundException, IOException
              try
         Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
         Sheet sheet = workbook.getSheet("ROLLUPS - Results");
         double summ = 0;
         double sub = 0;
         double result=0;
         for (int i = 0; i < sheet.getLastRowNum(); i++)
              Row row = sheet.getRow(i);
         Cell cell1 = row.getCell(0);
         Cell cell2 = row.getCell(1);
         if (cell1 != null && cell2 != null)
         String cellValue1 = cell1.getStringCellValue();
         String cellValue2 = cell2.getStringCellValue();
         if(cellValue2.contains("="))
         String stringNumber = cellValue2.split("=")[1].trim();
         if (cellValue1.contains("ADD"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         summ = getSumm(summ, stringNumber);
         else if (cellValue1.contains("SUB"))
         if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
         //System.out.println("Path Does Not Exist");
         else
         //System.out.println(cellValue1 + "/" + stringNumber);
         sub = getSubstraction(sub, stringNumber);
         /* else
         System.out.println("Smt wrong");
         System.out.println("ADD = " + summ);
         System.out.println("SUB = " + sub);
         result=summ-sub;
         System.out.println("RESULT = " result"0");
         catch(NullPointerException e)
              e.printStackTrace();
         catch(Exception e)
              e.printStackTrace();
         private static double getSubstraction(double main, String your)
         if (your.contains("-"))
         return main + Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main - Double.parseDouble(your.replace("+", ""));
         else
         return main - Double.parseDouble(your);
         private static double getSumm(double main, String your)
         if (your.contains("-"))
         return main - Double.parseDouble(your.replace("-", ""));
         else if (your.contains("+"))
         return main + Double.parseDouble(your.replace("+", ""));
         else
         return main + Double.parseDouble(your);
    Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
    column(o) column(1)
    Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
    Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
    Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
    Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
    Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[6] ECIN - INPUT VALUE (ADD)
    Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
    Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
    Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
    Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
    Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
    Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
    Row[13] ECIN - INPUT VALUE (SUB)     
    Row[14]
    Row[15] ECOUT EXPECTED VALUE     | 900.00
    Row[16] ECOUT ACTUAL VALUE     | 900.00
    Row[17] RESULTS     | PASS
    Row[18]
    Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
    Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
    Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
    Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
    Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
    Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
    Row[25] ECIN - INPUT VALUE (ADD)
    Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
    Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
    Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
    Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
    Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
    Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
    Row[32] ECIN - INPUT VALUE (SUB)     
    Row[33]
    Row[34] ECOUT EXPECTED VALUE     | 440.00
    Row[35] ECOUT ACTUAL VALUE     | 320.00
    Row[36] RESULTS     | FAIL
    Row[37]
    Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
    Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
    Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
    Row[41] ECIN - INPUT VALUE (ADD)
    Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
    Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
    Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
    Row[45] ECIN - INPUT VALUE (SUB)     
    Row[46]
    Row[47] ECOUT EXPECTED VALUE     | 640.00
    Row[48] ECOUT ACTUAL VALUE     | 720.00
    Row[49] RESULTS     | FAIL
    I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
    If my requirement is not clear, please let me know. Thank you.
    Edited by: 1002444 on Apr 25, 2013 11:20 PM

  • How to list the Cert Issuer for all servers in a Domain

    Hello,
    The objective is to list the Server name and Cert Issuer for any Cert found in the LocalMachine\My store on all servers in a Domain.
    Once I'd get to a server, probably by PS remoting, I'd issue the following:
    dir cert:\localmachine\my -recurse | ? Issuer -like '*'
    However, the output is Thumbprint and Subject, but I really need to see the Issuer, or what is displayed in the Certificates MMC under the 'Issued By' column.  What I need in my output is the following:
    ComputerName       Issuer
    Srv1                       Acme Cert Auth
    Srv2                       Host1.Acme.Com
    Any suggestions would be appreciated.
    Thanks for your help! SdeDot

    As you might suspect it is even easier than that:
    $omputers |
    ForEach-Object{
    invoke-command -ComputerName $_ -ScriptBlock {dir cert:\localmachine\my -recurse}
    } |
    select PSComputerName, Issuer
    ¯\_(ツ)_/¯
    Indeed.
    =]
    Both work great!
    Thanks for the response and help Mike and Jrv!
    Thanks for your help! SdeDot
    Cheers, you're very welcome.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • Implementing recursive taskflows

    Hi
    We have a requirement that a taskflow is allowed to call itself. As per documentation this seems to be allowed.
    These taskflows should be opened as a dialog.
    While i am able to invoke the taskflow recursively the issues i am facing:
    1. If i a open the task flow recursively, the previously opened taskflow dialog window is not visible.
    The currently open one is hiding it visually. Tried resizing the window but didn't help.
    When i close one taskflow the previous task flow becomes visible.
    Is it possible to keep the previous task flow visible?
    2. I am unable to handle the return event from the recursive task flows.
    I invoke these task flows from a button which has a returnListener but the method is never executed except for the base page from where i invoke the first time.
    Please let me know.
    Cheers,
    Raj

    Hi Raj,
    1. Yes - this should work. The previously launched dialog should be covered with an opaque glass pane that you can see though, but you should still be able to see it. Can you move the newer window? What display style are you using, external window or inline-popup?
    2. The dialog returnListener behavior is part of the ADF Faces layer of ADF. You may want to post that part of your question in the ADF Faces forum.
    Dave

  • Summing based on matched data

    I have an odd sum issue that's been plaguing me for a year or so and I figure it's time to get it taken care of.   I have some data that I have to sum.  I have to sum them based on the data in the first column.  Easier to explain with an example.
     Note that column D is what I want the result to be... columns A, B and C are the data I'm starting with.
    A B C D117 6 0 8
    117 2 0
    118 1 0 7
    118 0 3
    118 3 0
    121 0 1 5
    121 4 0
    For the above, what I'm looking for is a total of B&C, based on the value of A...  so all the B&C values where A is 117 adds up to 8.  All the B&C values where A is 118 adds up to 7, etc.  I don't even mind if the D result is duplicated
    in every row...  So the cells in D being 8, 8, 7, 7, 7, 5, 5 would be fine.  I just need to be able to see what the totals are for all of the entries that start with "117" versus the totals of "118".  
    I know there are lots of ways to slay this beast, but my problem is that I need it done in the way I've described... no grouping, no pivot tables, no calculations elsewhere.  I have LOTS of data that will continue to grow and this all gets exported
    to other places, so the formatting has to be pretty much what I have above.  
    Can someone get me pointed in the right direction here?
    --smthng

    Re:  sum with multiple criteria in multiple columns
    With the data starting in A3 and extending to row 99...
      =SUMIF($A$3:$A$99,A3,$B$3:$B$99)+SUMIF($A$3:$A$99,A3,$C$3:$C$99)
    Jim Cone
    Portland, Oregon USA
    XL Professional excel add-in (commercial program)
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

Maybe you are looking for