BEx query needs to count unique characteristic values

Is there any way to build a query using BEx query designer to count the number of unique values of a characteristic.  For instance, my cube has detailed transactions for claim information.  Each claim number can have multiple products.  My query need to show the number of claims that exist for each product.  I don't want the detail of the claim number, just how many claims exist.
Product          Gross Paid Loss        Claim Count
Total Auto                $ 43,865.01              ?
Total Property  $ 4,068,321.57              ?
Not assigned                19,426

Hi,
Creat calculated  keyfigure with data functions Count value and save with technical name.
Right click on that go to propertes, select count with exception aggregation - Claim Number,
also use after aggregation and decimal places '0'.
Regards
Malyadri

Similar Messages

  • Query Designer - how to count distinct  characteristic values in a column

    Hello Experts,
    I need to count the number of distinct occurences in a column and use it later for a percentage calculation. I'll give you a concrete example:
    Promotion_ID   Product    Promoted
    A  ******************  P1 ********  1
    A  ******************  P2 ********  0
    A  ******************  P3 ********  1
    B  ******************  P1 ********  0
    B  ******************  P3 ********  1
    C
    D
    A promotion ID can have more than 1 product associated with it. A product can be promoted (1) or not. A promotion_ID can be also empty (no products C and D)
    I need to calculate for each product the percentage of promotions where the product is promoted out of ALL promotions (4) or
    P1  25 %
    P2  0 %
    P3  50%
    How can I model this in the Query Designer ? How can I count the distinct Promotion_IDs ?
    Any ideas will be appreciated.
    Thanks
    Rado

    Hi,
    Please take a look at the docs below.
    https://websmp102.sap-ag.de/~sapdownload/011000358700002762432003E/HowToCount.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af
    Regards,
    ®

  • When we run query how it gets the characteristic values and attributes.

    Hi,
    When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert  DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
    Bye
    GK

    when we run the query how it checks and gets the characteristic values and attributes.
    Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID.

  • Bex Query - Show rows from another characteristic

    Hi Guys,
    I have a problem, I need to create a query to be displayed in Excel that shows accounting informacion by number, like this:
    Account         Balance
    12110201       1 USD
    12110202       1 USD
    12110204       1 USD
    That works so far, the problem is that I need to add 2 more columns and in 1 of the new columns I need to show only some accounts, like this:
    Account          Balance        NewColumn1
    12110201       1 USD      
    12110202       1 USD            Balance of 12110202
    12110204       1 USD
    the other one is more challenging because it need to show informacion from a different account, like this:
    Account          Balance        NewColumn1            NewColumn2
    12110201       1 USD      
    12110202       1 USD           Balance of 12110202
    12110204       1 USD                                           Balance of 2406910000
    the first values came from my accounts tables that contain balance from sub accounts, but the value 2406910000 is in fact a sub account value.
    Can some of you expers can help me on this? Is it possible?
    Please help.

    hmmmm
    let me ask this:
    You have multiprovider A
    in that u have Chars
    Account
    Subaccount
    Source of subaccount
    & Keyfigures
    $ amounts
    okey now, lets say u want to display the data as follow:
    $amount-----newcolumn1
    Account----
    2244--$2200--
    2245--$3200--
    bal. of 1234
    2246--$4200--
    2247--$1200-----bal. of 734
    is that what u are asking to display....
    if yes, bring Account in Rows
    bring $amount in Collumns
    add new selection1, in that add $amounts, then add Subaccounts from characteristics
    that way it will show $ for subaccount
    for e.g. in above case it will show $value for 1234 which is subaccount of 2245.
    My question is when you say "Balance of 22140000" what is that you intend to display here....you want to show $ of Balance i.e $45, $56 etc, or
    do you want to show Subaccount Number i.e 1234 or
    do u want to show specific texts "Balance of 22140000"
    my response above was related to this only, what is that you want to show in ur reports?
    what is available in ur multiprovider?
    if you wanna show specific texts  "Balance of 22140000", this cannot be done because you cannot just create texts in Query designers.
    If you wanna show specific $ amounts for that subaccount, answer is create restricted keyfigure
    if you wanna show Subaccount Number i.e 1234 etc, that means  you will have to create Replacement path variable and then replace values of Subaccount number into that column.
    Maybe you will not need cell definition then.
    i hope you understand what i am trying to explain..
    dont hesitate to reply with detailed explaination, and any questions.

  • Query needed for sorting by time value

    Hi Folks
    We have table it consists two columns like below
    Job_name varchar2(50)
    Scheduled_time date
    The filed scheduled time keep date and time value like below
    25-Jul-2009 4:00:10 AM
    26-Jul-2009 4:00:01 PM
    27-Jul-2009 4:00:00 PM
    28-Jul-2009 4:05:00 PM
    01-Jul-2009 4:06:00 PM
    02-Jun-2009 4:15:40 AM
    We need output as sorting by time value NOT date value. Expected output to be below
    25-Jul-2009 4:00:10 AM
    02-Jun-2009 4:15:40 AM
    27-Jul-2009 4:00:00 PM
    26-Jul-2009 4:00:01 PM
    28-Jul-2009 4:05:00 PM
    01-Jul-2009 4:06:00 PM
    I am using oracle 10G
    Thanks in Advance

    Here's how :
    SQL> create table job_table (job_name varchar2(50) not null, scheduled_time date);
    Table created.
    SQL> insert into job_table
      2  values ('Job_abc',to_date('25-JUL-2009 04:00:00','DD-MON-YYYY HH24:MI:SS'));
    1 row created.
    SQL> insert into job_table
      2  values ('Job_fdw',to_date('02-JUN-2009 04:15:40','DD-MON-YYYY HH24:MI:SS'));
    1 row created.
    SQL> insert into job_table
      2  values ('Job_fxj',to_date('27-JUL-2009 03:59:00','DD-MON-YYYY HH24:MI:SS'));
    1 row created.
    SQL> insert into job_table
      2  values ('Job_rjt',to_date('20-JUL-2009 14:59:00','DD-MON-YYYY HH24:MI:SS'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> alter session set nls_date_format='DD-MON-YYYY HH:MI:SS AM';
    Session altered.
    SQL> select job_name, scheduled_time from job_table
      2  order by to_char(scheduled_time,'HH24:MI:SS');
    JOB_NAME                                           SCHEDULED_TIME
    Job_fxj                                            27-JUL-2009 03:59:00 AM
    Job_abc                                            25-JUL-2009 04:00:00 AM
    Job_fdw                                            02-JUN-2009 04:15:40 AM
    Job_rjt                                            20-JUL-2009 02:59:00 PM
    SQL>

  • BEx Query: Percent Share based on characteristic

    My question is around a query that follows this sort of layout:
    Order  |  Doc No.  |  Account  |  Type  |  *Amount*
       1            1          1          A         20
       1            1          2          A         30
       1            2          3          A         40
       2            3          4          A         50
    I want to calculate the percent share by Doc No. so in this example, I'd want it to show like this:
    Order  |  Doc No.  |  Account  |  Type  |  *Amount*  |  *Percent*
       1            1          1          A          20         40%
       1            1          2          A          30         60%
       1            2          3          A          40        100%
       2            3          4          A          50        100%
    I've tried doing a forumla based on amount with Aggregation of summation on Doc No. and that didn't work. I also tried some of the other percent functions but unless the exact doc no. is drilled down on, they show the percent share for the entire report which doesn't work either. Any ideas? I feel like I've done something like this before but can't seem to get it to work! Points to an answer that yields the result I'm looking for!
    Thanks!
    Edited by: Christopher Deaner on Jan 16, 2012 10:55 PM

    Let me see if this example of what I'm seeing makes more sense:
    Order  |  Doc No.  |  Account  |  Type  |  *Amount*  |  *abs(Amount)*  |  *Percent*  | Expected Percent
       1            1          1          A          20            20          200%           40%     
       1            1          2          A         -30            30          300%           60%
                                       +Result+     -10           -10
       1            2          3          A          40            40          100%          100%
       2            3          4          A          50            50          100%          100%
    The absolute value of the Amount column is calculating the result of the original values (with the original signs). This result is being used in the Percent (%CT) calculation which is causing the calculated percent to be wrong. I tried changing the "Calculate Result as" setting to Summation which corrected the result row (in the above example it would show 50 for the abs(Amount) column) but the %CT calculation is still incorrect.

  • Bex query question:How to get total value ?

    For material level we can get value(quantityamount), but for the result is total quantitytotal amount, the result is wrong. How to get the total value correctly?
    I checked some material.which need coding. but I want to know if I can get easier way for that.
    Thanks.

    hi, i jus tried. .this works for me..
    set calculate result as summation and formula collision nothing defined...
    *reward if helpful*

  • Convert characteristic values in key figures in a query

    Hello all,
    i have a query which provides some key figures and also some probabilties (defined as characteristics). I want to multiplicate the probabilities with the key figures and therefore I need to convert the characteristic values for the different probabilities in key figures.
    What is the best wys to do this.
    Any help would be great.
    Best Regards,
    Stefan from Munich/Germany

    Stefan,
    You need to create a formula variable of your characteristic.
    In the Create Formula screen right mouse click on Formula Variable and go through the create process.
    The characteristic needs to stay in your query (you can change it's display to No Display) to pass it's value to the formula.
    Once you have done this you can use the formula Variable in any other formula.
    Regards
    Gill

  • Dynamic filter on time characteristics on OLAP SAP BEX query based universe

    Dear all,
    I'm currently working on the integration between SAP NetWeaver BI 7.0 and SAP BusinessObjects XI 3.1 FP 1.5 via integration kit.
    I've built an OLAP universe on the top of a BW query based on a multiprovider that contains 10 infocubes.
    Everything works fine but I need to create a filter in the OLAP universe that allows to restrict data by current date (e.g. using TIME characteristic of Infocube such as 0CALDAY or 0CALMONTH). From that filter we could start creating other conditions to compare data to different time periods.
    I've already tried to use a SAP exit variable in  a BW query but this kind of object would restrict query data only by current date and for example it would be impossible to browse data by previous years (to bypass this problem we could use restricted key figures with different offsets but we have too many key figures in the query and the number of restrictions
    would rise exponentially). 
    In a relational DataBase we can do that using a "where condition" based on 'CURRENTDATE' (SQL DB2 syntax).
    Now, we need to apply the same logic but translated in MDX syntax. 
    Is it possible to enter a dynamic filter in the OLAP universe or just fixed or promt values ?
    Any advise?
    Thanks in advance.
    Best Regards.
    M.

    Hi Ingo,
    1) My question is: "How can I have to manage variable in BEX queries and in the UNIVERSE in order to obtain the maximum flexibility to create reports with measures on actual day (for example) without asking the user to promt a value ?"
    I want to use an unique BEX query to define an unique UNIVERSE. On this UNIVERSE I want to create many reports (actual day, previous day, and so on).
    If I restrict 0CALDAY with an EXIT variable then shall I be able to create a different restrictions on the same Universe based on 0CALDAY ?
    2) Another question is:
    Is it possible to insert an XML / MDX filter on the OLAP Universe with dynamic derivation of the system date ?
    For example:
    Instead of this:
    <FILTER KEY="[0FISCYEAR].[LEVEL01].[NAME]">
        <CONDITION OPERATORCONDITION="Equal">
            <CONSTANT CAPTION="Z12008"></CONSTANT>
        </CONDITION>
    </FILTER>
    Is it possible to insert a tag with a dynamic function to derive the system date ?
    Thanks in advance.
    Best Regards.

  • Error while executing BEx Query on Composite Provider

    Hi,
    We have a BW on-HANA system, patch level SAPKW73105.
    We have created a Composite provider based on the union of two DSOs, two infoobjects, one SPO, and there are a couple of joins with two other DSOs, on the top of that we built a BEx query.
    While executing the BEx query, sometimes (depending on the filter values), We got the following error message
    "Attribute engine failed;Error executing physical plan: exception 6900: AttributeEngine/Parallel/DimensionFilter.cpp engine failed; $function$=getValidFemsPA;"
    "Error 6,900 has occurred in the BWA/SAP HANA server"
    "Error reading the data of InfoProvider @3ZSDRPCP5"
    "Error while reading data; navigation is possible"
    "Row: 59 Inc: MAP_TREX_EXCEPTION Prog: CL_RSDRH_TREX_STORAGE"
    (Attached error message)
    Ii We browse the composite provider data using the "display data" option in the RSA1, data is displayed without issue, the problem only appears during the BEx query execution and only with some filter vaues.
    Any idea on how to fix the issue.
    Thanks,
    Federico

    He's on 7.3 EhP1, which is on SPS12 today. It got pretty stable by SP08, SP09. SP05 was pretty early on, and had a lot of bugs in the HANA views.
    7.4 is on SP07 like you say, and most of our customers run at least SP06 - before then, you had to apply a bucketload of SAP notes. I would recommend customers apply SP08 with care because it's a feature release so will have a bunch of new features, which will no doubt need corrections.

  • Compare Characteristic Values

    I have run into a situation where I need to compare 2 characteristic values in a query.  I have one characteristic named "Sales PNL" and one characteristic named "Financial PNL".  The values for these characteristics are text like "BREAD" or "CEREAL".  I need to create a query that returns all the rows where "Sales PNL" does not equal "Financial PNL".  So, a row where both characteristics equal each other should not be returned from the query, but a row where one characteristic equals "CEREAL" and one equals "BREAD" should be returned from the query.  Any ideas on how to accomplish this?

    Hi Mark,
    What do these chars have as a Key Value (assuming BREAD is the text value)? And then does Sales PNL 101 (Bread) = Financial PNL 101 (Bread)?
    If yes, then you can create a formula variable that will be replaced with the key value (101). This converts it into a KF and then you can compare the values in a formula to return 0 or 1. Then create a condition on this formula to display the rows as reqd.
    Hope this helps...

  • Problem with Queries Structures in Bex Query Designer and Universe Designer

    Hi everyone,
    I have a problem when i try to do a Universe from a Bex Query Designer.
    When I use a Characteristic Restrictions in a Structure, the universe only show me the structure without the objects inside it.
    EJ:
    1) Bex Query Designer
    Colunms
    (Structure) ZSRT_123
                          - (Characteristic Restrictions) Reg Guayana
    >          (InfoObject)     0Product = 'XXX'
    >          (InfoObject)     0Country = 'YYY'
         - (Characteristic Restrictions) Reg Caracas
    >          (InfoObject)     0Product = 'AAA'
    >          (InfoObject)     0Country = 'BBB'
    Rows
    (Structure) ZSRT_456
                   (Key Figure)     Net Sales
    2) Universe designer
    (Class) ZSRT_456
    >(Measure)      Net Sale
    (Class)     ZSRT_123
    >(Dimension)      ZSRT_123
    The universe dont translate the two Characteristic Restrictions in the structure ZSRT_123.
    Any information would be much appreciated. Thank you.

    Hi,
    I assume that you are using BOE XI 3.1 SP2.
    We have added an option in SP2 to generate or not the L00 level.
    Unfortunately this option applies not only on characteristics but also on hierarchies, hierarchies variables and structures: that's the reason why you have no elements belonging to the structure generated.
    I recommend to always generate L00 in order to have your structure generated correctly.
    This issue will be fixed in SP3.
    Regards,
    Didier

  • IF ELSE Statement in BEx Query based on the results

    Hi experts,
    I want to realize the following IF/ELSE statement in a BEx Query in respect to the result values
    If the result of KF1 equals 0, than set the KF2 to 0, Else (KF1 NE 0) show the value of KF2
    Background: I want to report the order backlog. In the example above we have an incoming order value of 23.700,80 EUR in periode 12.2013 and an turnover of 22.370,80 EUR in periode 01.2014. The order backlog in ST (KF1) is 1 ST (12.2013) - 1 ST (01.2014) = 0 ST. The order backlog in EUR (KF2) is 23.700,80 EUR (12.2013) - 22.370,80 EUR (01.2014) = 1.330 EUR. The Order and Invoice is finished, but we have an positive order backlog in EUR (reason: less turnover as incoming order).
    For this case I want to realize the IF/Else statement to check if the oder backlog in ST = 0, if yes, than set the order backlog in EUR also to 0.
    Any best practices?
    Many thanks and best regards,
    Michael

    Hi Suman,
    thanks aigain for your reply!
    I have tried your proposal before you have posted it.
    In my special case the following if/else statement works successfully:
    CKF = calculated key figure
    Formula1 = (CKF1 == 0) * 0 + (CKF1 <> 0) * CKF2
    In my case the CKF2 is the result value from "Incoming Order value" - "Turnover"
    So I had to define a separate Formula (1:1 equals to CKF2) and then I was able to set "*CKF2" in the statement.
    The statement CKF2 = (CKF1 == 0) * 0 + CKF2 is not possible (because it´s not possible to calculate from CKF2 itself).
    Now it works
    Best regards,
    Michael

  • Get batch characteristic value

    Hi Experts,
    I need to get the characteristic value of a batch if I provide with batch number and characteristic name as parameters.
    Is there any standard function module for this?
    Regards
    Thanks in advance
    Prathib

    Dear,
    BAPI_CLASS_SELECT_OBJECTS gets objects for a class. If you want to retrieve the characteristics, try using BAPI_CLASS_GET_CHARACTERISTICS.
    or check FM CLFM_SELECT_AUSP
    Regards,
    R.Brahmankar

  • Crystal Reports 2008 and SAP BEX query.  Issue in retrieiving multiple recd

    Hi All,
    I have designed a crystal report which has BEX query as a datasource. The values from this query are placed in page header. Also two subreports are available which get data from an RFC. Main report and sub report are linked by primary key ID.
    (In the bex query one condition is implemented on a key figure)  When I run the BEX query , it retrieves single record. But when I execute the crystal report, execution says 2 records and my details section is getting repeated.
    I am unable to use filter as it is a keyfigure.
    Any suggestions or  help here is highly appreciated.
    Regards,
    Surya

    Hi,
    BEX query retrieves only one record (In the bex query one condition is implemented on a key figure) When I run the BEX query , it retrieves single record). I am puzzled on how the crystal is retrieving two records.
    Actually infocube has 2 records one with status "active" and the other with status "postponed". Some other fields also will vary.
    So, I cannot use this formula to supress.
    Regards,
    Surya.

Maybe you are looking for

  • File name in different directory

    i have a problem when saving files: I copied all the files from one directory to another ---with the same file name and I tried to make chnages in the new directory, But I found that all the changes I made in the new directory also happened in the ol

  • Java procedure equivalent in Oralce 7.3.4 ??

    Hi, Oracle 8i supports Java procedures, is there any workaround way of calling Java functions or Java programmes from PL/SQL in Oralce 7.3.4 (Solaris). Thanks in advance, -Sudarshan [email protected]

  • Copying files that are updated.

    I wanted to make a program that copies files from a directory (and subdirectories) to another location. So let's say I have a folder in C:\myfolder . In this folder there is another folder (myfolder2) and some type of file(s) (.txt .docx etc.). In my

  • What is an appliaction Log??

    I have read a bit about logs. And i feel logs are nothing but messages of different types stored in the DB with a unique id. Can anyone tell me how the objects and the subobjects required for log header are created?? And how will i know as to the log

  • LSMW for F-05 transaction

    Hi All, I want to upload the data for the transaction F-05 through LSMW. IS there an ystandarad program or bAPI or IDOC is avaliable for this transaction. Thanks