Exception aggregation of row count

Hi Experts,
I have Value of Purchase Order Report in which i have display the Number of PO, Number of PO items and netpovalue.
For calculating the Number of PO and PO items i am using a record counter keyfigure (0rowcnt) aggregated at po number and  po item ref.charateristic.
For PO item i am getting the accurate results but for PO number i am not.
example :-
pur-org       Number of PO   PO-item  Netpovalue
xxx            5                     10               yyyy     
but it is showing :-
pur-org       Number of PO   PO-item  Netpovalue
xxx            10                    10               yyyy     
Please suggest how to get exact PO value.
Regards,
HR

In yr case Number of PO is the counter field, so create a Key figure for counter and use the following aggregation option :
Aggregation : SUM
Exception Aggregat. : Counter (Values Unequal to Zero )
Agg.referen.char. : 0CALDAY

Similar Messages

  • Scenarios for some of the Exception Aggregation

    hello Experts,
    Please explain some scenarios for the following Exception Aggregation:
    1. Counter (value not equal to zero)
    2. Counter (all values)
    3. Average (value not equal to zero)
    4. Average (weighted with no. of days)
    5. Average (weighted with the number of workdays; factory calendar)
    Thanks in advance.
    Regards
    Lavanya.

    Hi,
    check this link
    http://help.sap.com/saphelp_nw70/helpdata/en/82/f2dc37f0f12313e10000009b38f8cf/frameset.htm
    hope this helps you
    Best regards,
    Ramesh.

  • FBL5 FIAR - exception aggregation - count customers with open items at key

    Hello gurus,
    I have read the information about counting all values in reference to a characteristic. I manage to count how many customers have a FIAR open item 'billing status' = Open in my FIAR cube.
    Now I am asked to replicate transaction FBL5 of R3. This transaction will give you open items at a given key date by adding
    the items with
    A) Item status = 'O' and posting date <= key date
    and the items with
    B) Item status = 'C' and posting date < =key date and clearing date > key date.
    I calculate the net value by creating 2 restricted key figures and then adding them in a CKF.
    But for counting I have a problem. I can count how many customer make up the open items (case A)
    and how many customers makeup items that where cleared between key date and today.(case B).
    But I cannot sum the two numbers as there might be customers that are counted in both cases.
    For example I have 4 customers that correspond to case A : 1000 1011, 1012 and 1014
    And I have 3 customers that correspond to case B  1000 , 1011 and 1013
    I would like to get 5 as the number of customers that verify either case A or case B (or both).
    Is there a way to do this with the exception 'aggregation 'and 'count all values' property of CKF ?
    Claudio

    Hi,
    The logic given in the above post may be a bit confusing to you. Check out this explanation and try to understand what I mean.
    Posting Date - PD
    Key Date - KD
    Clearing Date - CD
    PD--KD--
    CD
    -O(Status)-C--O-----C
    -5107-----8
    Let me explain the above table.
    Between PD & KD there are 5 count with status'O' and 10 counts with status 'C'.
    Between KD & CD there are c counts with status 'O' & 8 counts with status 'C'.
    This means 5 with status 'C' becomes 7 between KD & CD.
    Similarly, 10 status with 'O' becomes 8.
    The logic I am trying to say is..
    If you don't want to get counts with status 'C'(repeated) as I understood) 7-5 = 2. Show this 2 as count for status 'C' between KD & CD.
    So the table will become like this now.
    PD--KD--
    CD
    -O(Status)-C--O-----C
    -5102(7)---2(8).
    In braces shown are the total with status 'O'/'C' for the dates.
    I hope this will solve your problem.
    Message was edited by: AVR - IGA

  • Java.sql.SQLException: while calculating row count: Unexpected exception :

    I am working with JDBC that is connected to MS Access 2003 file.
    I wrote and tested in MS Access following query and all it is working well. If I write this query and execute it is working well.
    pstm = DBConnect.prepareStatement(
    "SELECT Parameter.Name, Parameter.id FROM " +
    "(ParameterGroupMember INNER JOIN ApplicationReadsParameter ON " +
    "ParameterGroupMember.Member_Parameter_id = ApplicationReadsParameter.Parameter_id)" +
    "INNER JOIN Parameter ON ApplicationReadsParameter.Parameter_id = Parameter.id " +
    "WHERE (ParameterGroupMember.Group_Parameter_id=40) " +
    "UNION ALL SELECT Parameter.Name, Parameter.id FROM " +
    "Parameter INNER JOIN ApplicationReadsParameter ON " +
    "ApplicationReadsParameter.Parameter_id=Parameter.id WHERE (Parameter.id=40); ");
    rs = pstm.executeQuery();
    When I use code, that sets parameters in the statement it is firing following exception
    java.sql.SQLException: while calculating row count: Unexpected exception : 1
    at sun.jdbc.odbc.JdbcOdbcResultSet.parameterQuery(JdbcOdbcResultSet.java:6417)
    at sun.jdbc.odbc.JdbcOdbcResultSet.calculateRowCount(JdbcOdbcResultSet.java:6336)
    at sun.jdbc.odbc.JdbcOdbcResultSet.initialize(JdbcOdbcResultSet.java:155)
    at sun.jdbc.odbc.JdbcOdbcStatement.getResultSet(JdbcOdbcStatement.java:424)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:93)
    pstm = DBConnect.prepareStatement(
    "SELECT Parameter.Name, Parameter.id FROM " +
    "(ParameterGroupMember INNER JOIN ApplicationReadsParameter ON " +
    "ParameterGroupMember.Member_Parameter_id = ApplicationReadsParameter.Parameter_id)" +
    "INNER JOIN Parameter ON ApplicationReadsParameter.Parameter_id = Parameter.id " +
    "WHERE (ParameterGroupMember.Group_Parameter_id=?) " +
    "UNION ALL SELECT Parameter.Name, Parameter.id FROM " +
    "Parameter INNER JOIN ApplicationReadsParameter ON " +
    "ApplicationReadsParameter.Parameter_id=Parameter.id WHERE (Parameter.id=?); ");
    pstm.setInt(1, 40);
    pstm.setInt(2, 40);
    rs = pstm.executeQuery();
    Further I found that the problem is with the setting of the second parameter in the statement. Is there different way how to set the second parameter if union is used?
    Thanks and regards,
    Jan

    Jan.Hv wrote:
    I am working with JDBC that is connected to MS Access 2003 file.
    Use code tags when you post code.
    I wrote and tested in MS Access following query and all it is working well. You mean it works in MS Access. Not that it works in java.
    >
    pstm = DBConnect.prepareStatement(
    "SELECT Parameter.Name, Parameter.id FROM " +
    "(ParameterGroupMember INNER JOIN ApplicationReadsParameter ON " +I STRONGLY suggest that rather than putting spaces at the end of each part put it at the beginning. It makes it much easier to get it right.
    I also suggest formatting the code. There are various ways.
            // Wrong
            String sql = "select x, y z "
                             + "from table1 t1, idtable idt"
                             + "where t1.tim=idt.tim "
                             +  "and t1.book = idt.book";
            // Right (spaces) - one way to format
            String sql = "select"
                             + "         x, y z"
                             + " from table1 t1, idtable idt"
                             + " where"
                             + "          t1.tim=idt.tim"
                             + "          and t1.book = idt.book";Your code is in fact missing a space. No idea if that is a problem or not.
    Remove the semicolon from the end.
    PRINT the sql before you use it, copy/paste and use that string in MS Access (replace the ?) to see if it work.
    Further I found that the problem is with the setting of the second parameter in the statement. Is there different way how to set the second parameter if union is used?The MS Access ODBC driver isn't really great for actually reporting errors correctly. So usually any error means something is wrong and it is up to you to figure out the exact problem.

  • Exception aggregation in one CKF causing problem in Result row of other CKF

    Here is my scenario in 3.5x BW:
    I have a CKF A which has exception aggregation (to select maximum value) based on a reference characteristic..
    Now this CKF A is used in another CKF B and a third CKF C is being calculated based on CKF B. SInce I am using exception aggregation in CKF A, CKF B and C had to be set to be calculated 'after aggregation'.
    Formula for CKF C = 100*B/ D   (D is another constant CKF, with value 1 for each row).
    Now my requirement is that the result row of CKF C should be calculated using the same formula on result row of B and D. This was working when I was calculating A without exception aggregation. But now I need to use exception aggregation aswell as I want the result of C = 100 * Sum(B)/ Sum(D).
    I have tried the alternative of using a Formula selection (with formula collision - Result from this Formula)instead of CKF for calculating 'C', but didnot find any success in getting result row of C as per my requirement.
    Any suggestions in resolving the issue will be higly appreciated..
    Thanks
    Shikha

    you have created a calculated key figure A in your query, and in the properties of this calculated key figure you have defined the exception aggregation right?
    so you can create a second calculated key figure (say A') with the same definition as ckf A, but you don't put any exception aggregation in it. then you need to create a second calculated key figure (say B') to replace the calculated key figure B, and use ckf B' in this new ckf.
    when you use now the calculated key figure B' in the formula of ckf C, it should be correct as you use ckf A' as basis, which has no aggregation...
    quite straight forward, no?
    M.

  • MDX query with DMV to get all cubes and aggregation row count on SSAS engine

    Hi All,
    How can I get all cube names  on a SSAS engine server and count of number of aggregation rows in each cube ?
    I got a DMV where it shows all catalogs names and description but where can I found aggregation row count of each cube.
    Please let me know, thanks in advance.
    Maruthi...

    Hi Maruthi,
    Please check below link, hope this will help you.
    SSAS 2008 CTP6 – new DMV $SYSTEM. DISCOVER_ OBJECT_ ACTIVITY
    lists the memory usage and CPU time for each object i.e. cube, dimension, cache, measure, partition, etc. They also show which aggregations were hit or missed, how many times these objects were read, and how many rows were returned by them:
    Discover_object_memory_usage and discover_object_activity
    select * from $system.discover_object_memory_usage
    select * from $system.discover_object_activity
    Thanks
    Suhas
    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.
    My Blog
    Follow @SuhasKudekar

  • Query Problem With Exception Aggregation

    Hello,
             I have two I/O 0Customer and 0Cont_Acct and also I have a Infoset made out of both. Here is the problem i am trying to solve,
    I want to figure out the customers who has more than five contract accounts associated with each customer number.
    Here is the solution I approached....
        1) Created a formula variable counter on the KF # of data records (which is provided in the Infoset automatically ) with exception aggregation total while referencing the contract acct I/O.
       2) Kept my customer #  and Contract acct on my rows area.
    The results I am getting is less than satisfying.  I am expecting   this output below.
    Customer #                 Cont Acct                  Total No of Cont.acct
    A                                  1001                                1
                                         1002                                1
                                         1003                                1
                                                                                  3
    B                                  1007                                 1
    I would appreciate anybody's help in this.  Thanks a lot.
    -A

    Hi,
    We have the same problem and raised an OSS ticket. They replied us with the note 1257455 which offers all ways of improving performance in such cases. I guess there s nothing else to do, but to precalculate this exception aggregated formula in data model via transformations or ABAP.
    By the way, cache can not help you in this case since exc. agg. is calculated after cache retrieval.
    Hope this helps,
    Sunil

  • Exception Aggregation for a Calculated Key Figure in a Structure

    Hello BI world,
    Please can someone tell me if it is technically possible to use "exception aggregation (count) in a calculated key figure within a structure.
    The definition of the structure is:
    Rows: Characteristic (Selection) = Problem type (0CATCODE_FE)  = "AF01"
    Colums (Selections) Month 1 , Month 2, Month 3, etc .. Total
                 Details of the selection for each month
                           0CALMONTH = Variable (offset+1 for Month 2 , 3 etc)
                                   1KYFNM = CKF
    Calculated Key Figure (CKF) =
                       General Tab:  = Key Figure "0CAUSE_CNT"
                       Aggregation Tab - Exception Aggregation = Count All Values
                                                 Ref Characteristic = Problem type (0CATCODE_FE)
                                                    Calculation After Aggregation = not ticked
                       Local Calculations Tab = All "Nothing Defined"
    What I am trying to achieve is the "count" of "Category codes"  for each month specified in the structure.
    I have looked in the cube and there should be a "category Code" count of "9" for Jan 2008 for notifcation type AF01 but the query shows 0?
    Thanks in advance, points will be awarded.
    Steve

    Still not working? Not sure why? Have tried both answers and just not counting...
    Is there any restrictions on using "exception aggregation" in a calculated key figures in a structure?
    The structure is in the columns and it is a selection that includes the CKF with the exception aggregation plus a restriction on calendar month using a variable?
    Any help greatly appreciated.
    Thanks in advance.
    Steve

  • Exception Aggregation (Average) displaying incorrect values after EHP1 Upgr

    Hi All,
    Exception Aggregation (Average) displaying incorrect values after EHP1 Upgrade in our BW system
    We have recently upgraded the system to EHP1. After the upgrade some of the queries where we are using Exception Aggregation (Average) started giving the incorrect values.
    Eg. We are displaying three Key Figures KF1, KF2 and KF3 (=KF1 %A KF2) against Store Hierarchy. In KF3 we are using Exception Aggregation (Average) on a characteristic 0PLANT.
    There are 14 rows against 0PLANT and out of those 2 rows are blank for KF1, so for KF3. When it is calculating the average of these key figures its dividing the total value by 12 instead of 14 which is not correct in our case. Earlier it was dividing the total by 14.       
    So in this case 'Average' and "Average of all values <>0" are behaving the same way.
    Kindly provide some inputs on this.
    Best Regards,
    Sachin Verma
    +44 7506740018

    Hi,
    Thanks for viewing the thread. And happy to let you know that the issue was resolved.
    The solution was:
    Two formulas (local) were created, one including the formula variable with replacement path for ZD1, with exception aggregation on ZD1, and the other with formula variable with replacement path for ZD2, with exception aggregation on ZD2. Both these formulas are hidden.
    Another formula (local) was created for u2018time takenu2019 = formula with ZD1 u2013 formula with ZD2, with exception aggregation total on u2018ZDOCNOu2019.
    For the second instance, when one requires exception aggregation on records that has multiple values for keys, a nesting of formulas can be done displaying only the ones required.
    For e.g. a formula with exception aggregation on say characteristic u2018item no.u2019 can be hidden, and included in another formula for exception aggregation on characteristic u2018document no.u2019. This is a typical case where one can achieve calculation before aggregation for a calculated key figure, formula or a counter.
    Hope it might help someone, and saves time and effort for a similar issue posted.
    Also would like to keep this thread open for exploring better solutions.   
    Regards,
    Vijay

  • How to get the row Count of a ResultSet

    How to get the row Count of a ResultSet

    Hi
    I'v tried rennie1's way ,but I only get zero,my code is:
    rs.executeQuery("select count(*) from t_test");
    if (rs.next()) int rowCount=rs.getInt(1);
    I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
    I tried another way,the code is:
    while rs.next(){
    // Do nothing ,just move the cursour to the last row
    int rowCount=rs.getRow()
    However,the rowCount still equal zero
    Any help would be greatly apprecite!
    note:
    I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle.

  • Exception Aggregation help in Bex !

    Hi Experts
        Iam creating a query with date calculations. I have the following calculations in my qry...
    1 . Cycle Time      :  ( Doc Date - Quote sent date) ....I created two replacement path variables and use them in formula.
    2 . Nr of Quotes    :  ( Count of all sales orders with Block L1 & L2) ...I created a CKF for counting the nr of docs then used that CKF in an RKF to filter by block. 
    3 . Avg Tender Time :  ( Nr of Quotes / Doc date - Quote rec Dt) .........Created a formula same as 1 with Quote rec dt instead of Quote sent then created another formula to make 2/3.
        Now when I execute the query Iam getting numbers but
        Cycle Time I took Exception Aggregation as Counter for all detailed values and ref char as Doc Date....Its giving some nr as output...but my question is if I take doc date as Ref char how it gets the calculation from replacement
        Does any one have worked on date calculations as the above situation / any one have any how to's which explaines how to find date calculations with exception aggregations?
    Thanks in advance...

    fixed

  • How to hide the all rows except the result row in a report?

    Hi Experts,
    We have a report in which the user is interested to see only the result rows and I need to HIDE the characteristics in the rows. I was successfull in doing the same for Key figures in columns using "Calculate single value as suppress result". But I am not finding a way out to hide the characteristics in the rows.
    If I move the characteristics in rows to Free characteristics, the result row is not getting dispalyed. Also, the characteristics are  used dynamically by the formulae in columns and hence i cant remove these characteristics from the query. . The user wants the query to contain only one characteristic in the row and the result row for the key figures in columns. The report currently displays Invoice level data for each customer and this needs to be eliminated and it should display the summarised  data for every customer. Please suggest how this can be accomplished
    Regards,
    Kavitha

    Moving the char to free char will show the equivalent of result.
    Your issue likely is that this breaks the calculations since you do want the calculations done at detail level.
    To achieve this, move your char to free char (say it is 0CUSTOMER).
    For the CKF/Formula, go to aggregation tab, set the exception aggregation as Total (or whatever it was in standard behavior) and specify reference characteristic (in this case 0CUSTOMER), also check the 'Before aggregation' if you have that checkbox there.
    This will ensure the calculation is done at detail level even though the char is not included in the rows.
    If you have multiple chars to be moved to free char but included in detailed calculation, you will need to build cascading CKFs (CKF1 with ref char1, CKF2 eq to CKF1 with exception aggr on ref char2...and so on).
    Added:
    I understand you do want 0CUSTOMER in there, but something else (let us say 0DOCNO) removed. Use 0DOCNO in place of 0CUSTOMER in the case described above.
    Edited by: Ajay Das on Aug 5, 2009 8:57 AM

  • Bex Exception Aggregation in 3.5 equivalent to 'TOTAL'

    Hi All,
    Can anyone help me in getting a functionality equivalent to exception aggregation 'TOTAL' in BW 3.5.
    I have  a requirement which can only be fixed using the exception aggregation 'TOTAL', my bad in my current client they dont have BI 7.0. So can anyone tell me what is the equivalent function of 'TOTAL' in BW 3.5.
    Regards,
    Anand

    I need to develop a report which will show Org unit & degree (education data) wise head count and annual salary.
    As the education records for an employee will be more than one, the annual salary will be doubled or tripled in the DSO or cube.
    If I do an average of annual salary based on employee the overall result goes wrong.
    Say for example, empl 20045789 as three record with KF value 10,000, the result in the report I see as 30,000.
    SAY in the backend
    EMPLOYEE    |  Degree | Annual Salary
    20045788  |     A | 50,000
    20045788  |     B | 50,000
    20045789  |     A |10,000
    20045789  |     B |10,000
    20045789  |     C |10,000
    In the query I get it as
    Org Unit |      Employee |     Annual Salary |  Average(Annual salary/ Number of employee)
    100001 |           20045788 |     100,000 |          50,000
    100001 |          20045789 |     30,000    |          10,000
    overall result                130,000 |          26,000  (130,000/5)
    The expected result is 50,000 + 10,000 = 60,000 / 2 = 30,000.
    Pls provide me solution.
    Regards,
    Anand
    Edited by: araj123 on Jun 3, 2011 3:45 AM
    Edited by: araj123 on Jun 3, 2011 3:46 AM
    Edited by: araj123 on Jun 3, 2011 3:47 AM
    Edited by: araj123 on Jun 3, 2011 3:48 AM
    Edited by: araj123 on Jun 3, 2011 3:50 AM
    Edited by: araj123 on Jun 3, 2011 2:25 PM

  • Exception aggregation on Non-cumulative key figure

    Dear experts,
    I have a problem. We have an InfoCube in BW in which the Activity Journals are loaded every day. In this Activity Journals it is registered that a Material was listed (available) at a customer (value 0 or 1).
    We have a non-cumulative key figure MXW_LISTN with inflow (MXW_LISTI) and outflow (MXW_LISTO). In time this key figure receives +1 or -1 for a customer, material combination.
    I want to use MXW_LISTN in the query in a specific way. The key figure on itselve tells me how many listings there are. However, I want to know how many business partners there are with a listing.
    I was thinking about an exception aggregation on MXW_LISTN with reference characteristic 0BPARTNER and "Count <> 0". BW however refuses to do so and only lets me do simple aggregations such as AVG, MIN, MAX etc.
    Can you think with me and come with an proper solution to count the number of business partners with a listing?
    Your help is very much appreciated and rewarded!
    Best regards, Hans de Klein

    Maybe a solution with virtual key figures is an option?
    Please help me out!
    Best regards, Hans de Klein

  • Forumla Variable with Exception Aggregation

      Hello,
    I've CKF in BEx, in this CKf there is replacement path Formula variable calculating number of documents.
    Formula variable is replacing the value of Document number infoobject.
    So definition of CKF is -> Replacement path Formula variable *1
    Ckf is restricted to summation with  Exception aggregation on Document number.
    This implementation is working fine but issue is its taking lot of time in query ,like while checking RSRT olap :data transfer(Event ID) is taking lot of time,majority of the query execution time and counter is going somewhere around 100K.
    Do you know is there a way we can implement this count in transformation?
    Thanks in Advance!

    Hi,
    Doing SUM in transformation takes a long time as you need to read all the content in target.
    So it is better to fine tune the query.
    1) Is query running long time for small selections ?
    2) Trace the query in RSRT and check where it is taking long time like Data base level , Application level
    Thanks
    Jagan

Maybe you are looking for

  • SALE ORDER CREATION WITH LSMW

    Hi Can we upload open sales orders through ..LSMW ...if it is posible ..pls tell me procedure In LSMW   Steps  recording step .. can we tcode VA01...? REGARDS SESIDHAR

  • How to leave a mail copy in Server

    Hi, I would like to leave a copy of my mails in the server.  I am using iMac and iPhone, configured to receive mail from the same account.  Until recent times, i use to get mails in both.  But, now my iPhone doesn't retrieve the mails.  I went to onl

  • How can I set the order of search engines on my Macbook?

    When I use "Manage Search Engines" to rearrange the order of my search engines, the order changes temporarily, only to revert to the order the search engine add-ons were installed, the next time Firefox is restarted. How can I set the hierarchy of se

  • IE11 - Crystal Reports - PrintMode ActiveX now displaying PDF prompt (instead of printer prompt)

    I asked this question over at stackoverflow and am now taking it here: http://stackoverflow.com/questions/20672254/ie11-crystal-reports-printmode-activex-now-displaying-pdf-prompt-instead-of It's a simple straight-forward question.  IE11 is breaking

  • Reg: JDBC Adapter without Update Query

    hi friends i have designed a scenario where JDBC as a sender. i need to configure the adapter without using update query