How to count a characteristic (Query Design)?

What is the best way to count a characteristic in a query?  To be more specific, I would like to count the number of orders (characteristic 0COORDER).
I have read the whitepapers:
-HowTo Count the occurrences of a characteristic relative to one or more other characteristics
-HowTo Calculate with Attributes
I would like to build a query that looks like the following:
Order Type      # Orders
A                      3
B                      5
C                      4
In my InfoCube,
OrderID OrderLineID MaterialID Quantity Price ZCount
1                             1
1                             2
2                             3
3                             4
3                             5
3                             6
I added a counter to my infoCube which counts the number of line items per order (from HowTo count occurences of characteristic whitepaper).  <b>However, now I need to count the number of orders.</b>
One approach I tried was to create a dummy calculated keyfigure, which i set to a constant of 1.  I then created another calculated keyfigure and used Count ( dummyKeyFigure).  I could have also achieved the same result by using SUMGT (dummyKeyFIgure).  However, this only works if you have orderID in your query row:
OrderID      dummyKeyFigure (hidden)         
1                        1
2                        1
3                        1
Result:                3  (SUMGT of dummyKeyFigure)
I also read a thread that discussed another alternative on how to use a replacement path variable to count a characteristic (using the key)... however the procedure wasn't clear.  When I tried to create a variable on orderID using a replacement path, it asked for either a variable or query to use... and I got "stuck" from there.  Can you use a replacement variable to count the number or orders? 
What are the different alternatives (and procedures) for counting the number of orders?
Thanks,
-B
Message was edited by:
        Brendon Lipchen
Message was edited by:
        Brendon Lipchen

Hey Olivier.
I do have Key Figures in my cube.  However, I only want to count the number of Orders in my InfoCube.
For your solution, you say to create a CKF.  In order to create a CKF, you need a KF to put in your CKF calculation (note you omitted this step from your solution).  There is no KF in the infocube to use for the Order count (we are creating "this" CKF to get the Order Count).  If there is no KF you can use in your InfoCube to get the Order Counter, then you need to create a replacement path variable to use in your CKF calculation.  After you have created a replacement path variable for OrderID, you can place this variable in your CKF calculation (instead of using a KF).  Make sense?

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,
    ®

  • How to Count a Characteristic Occurence?

    Morning,
    I have Assembly(Material) being displayed as a Row item in my query. My need is to count the number of rows for Assembly in the query. I referred to "How to Count" doc, but that counts every occurence of assembly. Whereas, I need to count an Assembly just once.
    Can somebody help me on this?
    Thanks.

    Vijay,
    Here is how it is desired:
    Plant   Assembly  Count
    7835   711712101    1        
    <   >   711712103    1
    <   >   711712111    1
    <   >   711712401    1
    <   >   711713101    1
    Can you explain how I can do with this?

  • Bind option in report. How to change setting in Query Designer?

    Hello,
    Is there any way of changing the 'Bind display of textx/attributes in data provider result and in value help' in the portal. We can change this option from the report by right clicking on the characteristic -> Properties -> Characteristic -> Selecting the 'Advanced' tab. But we want to make a permanent change to this option from the query designer so that the users would not have to change it every time they run the report. Can anyone point to where I can make that change in the query designer or anywhere else if that works?
    There is a characteristic say 'XYZ'. It has a attribute 'ATTR'. We want to display the attribute alone in the column of the query. We are able to do so by bringing the characteristic 'XYZ' and dragging and dropping the attribute 'ATTR' under it. We then change the display options to make the characteristic as 'No dispaly'. But this affects not just the characteristic in the columns, but also in the Navigational blocks. So the users are not able to see any values while filtering. One way to fix this is to uncheck the 'Bind display of textx/attributes in data provider result and in value help' option after the report is executed which is an end user task. But we want to find out a way of changing this from the query designer, so that the users won't need to carry out his activity every time they run the report.
    Any help is appreciated.
    Thanks

    <p>There are a few ways that you can achieve this. If your SQL Queries have their filters modified (ie. WHERE clause) then this can be easily solved by adding report parameters to the Report filter. Search the in-product help for "Record Filter" and you should get a number of helpful resources returned.</p><p>Additionally, you can pass in java.sql.ResultSet objects with a populated recordset of the data you want to show in the report. We don&#39;t currently provide any tools to assist the creation of the code stubs for thick-client applications (like we do for JSP pages) however you can download a collection of thick-client sample code from here:</p><p><a href="http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip">http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip</a> </p><p>As I mentioned, this sample contains a collection of code snippets. The one in particular you will be interested in is titled "JRCResultsetDatasource". Hopefully, this will provide you with a few options. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>

  • How to use "%CT" in Query Designer

    Hello everyone,
    i read that to calculate "Percentage Share of Result" in Query Designer we can use "%CT operator".
    But in my Query Designer (Version 7.10, SP10, Patch1) only "%" and "%A" are available to use. There ist no operator named "%CT".
    Can someone tell me how to use this operator?
    Thanks a lot and best regards,
    Susanne

    Hi,
    In the % Functions in a Formula you can find %, %A, %CT, %GT, %RT all 5 of them .
    My BW system is at Following Upgrade level:
    Software Component    Release    Level    Highest Support
    SAP_BW                701       0007            SAPKW70107
    If at a lower upgrade level, you need to upgrade till Specified BW Release to view these Fxn.
    You can check yours at System (Top of the window) --> Status . Click the Icon of magnifying glass named Componenet Info to view yours.
    Regards
    Raj Rai

  • How to start working with query designer?

    Hi,
    I am new to SAP BI. Could you please help me in guiding to start working  Query Designer?
    Thanks in Advance.

    hi,
    hv a look on this e-learning:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d002a24a-785c-2a10-4fa6-cc15ef25502a
    https://www.sdn.sap.com/irj/scn/bi-elearning?rid=/webcontent/uuid/50110617-6ede-2a10-f889-d276bd351509&startindex=21 [original link is broken]
    and also
    http://www.sap-hefte.de/download/dateien/1090/086_leseprobe.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4096b8fc-6be7-2a10-618e-b02a5e5e798f
    http://help.sap.com/saphelp_nw04s/helpdata/en/9d/76563cc368b60fe10000000a114084/frameset.htm
    hope this help.
    Regards,
    Archana

  • Query Designer: Ideas how to calculate remainng weeks?

    Hello!
    I'm fairly new to BI, so bear with me...
    I'm creating a query and I need to have a column that calculates a correction value for a weekly target value.
    The general idea is a very simple logic. Based on previous year's net sales a 10 % increase is the target level for the current year. But if current sales are lower than the set target, I would need to create a logic that raises the target for the remaining weeks of the current year.
    In other words, if  01.2006 the sales were 10, then the target for 01.2007 is 11. If sales in 01.2007 are only 9, the sales target has to be higher for the remaining weeks to reach 10 % yearly growth in sales.  So the weekly addition to the target values for weeks 02.2007 - 52.2007 would be 11+(11-9/remaining weeks).
    Any ideas on how to solve this in query designer? BI version is 7.0.
    Points rewarded naturally!
    Thanks in advance,
    Antti

    Hello Antti,
    You have essentially done the hard part which is define what you actully need in your query.
    My advice to you (and there would be many ways to do what you require) would be to create a "Calculated Key Figure"
    So using your example your calculated key figure should be,
    TARGET + (TARGET - ACTUAL / "REMAINING WEEKS")
    REMAINING WEEKS I would create a variable, without going into too much detail here are two sites which I have found useful in the past.
    http://help.sap.com/saphelp_nw04/helpdata/en/61/579b3c494d8e15e10000000a114084/content.htm
    and
    http://help.sap.com/saphelp_bw33/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/frameset.htm
    Hope this helps Antti
    Regards
    Ben

  • How to create a profile to control the access to Query Designer 2004s

    Hi all,
    I saw the note Note 962530 - NW04s: How to restrict access to Query
    Designer 2004s , where in alternative solution there is the approach on
    how to create a database table and modify the function module to control the access.
    However, we need to a security profile check that can prevent or allow
    who can access 04s tools. Because this is easy to maintain and we don't need to modify the database table time to time.
    Please update if it is feasible to have a check within the profile
    of the users to acces 04s query desinger. This way we can control
    effectively who can access new tools.
    Thanks,
    Dicky

    I can suggest that as this is a Security you might wanna ask the Person who is handling Security in your office.
    He can add different Roles which can then control their acess.
    For e.g. if you want that your user should be able to run Specific Queries a,b,c,d created by you.
    I will suggest interact with SEcurity Personal and ask him to create a Role X.
    You can then publish  your queries in Role X.
    So your users will have acess and security for X and they will then run the queries from them.
    Likewise, different other options are also there.
    If your queries are on Planning cube then things like giving them acess to Tools should take place similarly in different fashion.
    Your user can also use Query desinger and can opne queries from Roles .
    Hope this helps.

  • Condition judgement in Query Designer

    Hi,gurus.
    I want to realize the function as follows:
    If VALUE <= 0 then display VALUE as 0.
    if VALUE >0 then display VALUE.
    How to realize that in query designer? I've tried to create a formular but I can not find IF condition in Functions.
    Thanks,for a lot.

    Hi,
    In the query designer you will have to create a new formula and in the right hand side panel you can use "COUNT" function from Data Functions folder to satisfy your requirement.
    There is one more similar function in Data Functions (I don't remember exact name now) which you can check, from description it will be clear to understand which one to use.
    Regards,
    Durgesh.

  • What is the use of Condition is Query Designer  ??

    What is the use of Condition in Query Designer  ??
    How to use condition in   Query Designer  ??

    Hi,
    Conditions in a query can be defined for both characteristic combinations and key figures.
    Characteristic combinations can be used using the ranking list functionality (e.g Top N or Last N customers with highest sales).
    Key figures can be assigned the value limit conditions ( for e.g. display only rows in the query for which the key figure > 10 ).
    For your specific requirements in which you need to display only a limited set based on the key figures, then you can go for conditions.
    The conditions can be allowed to work on all the drill down characteristics independently, single characteristics or combination as well based on your requirement.
    While execution the report, you can activate or deactivate the condition anytime by right clicking on the data cells.
    Regards,
    VA

  • SSO with Query Designer

    Hi all,
    I need to add a link to SAP Query Designer in Portal that will launch Query Designer using SSO.
    We have SSO with R/3 and with BI already implemented (the user will click on the link and launch SAP GUI without having to type username/password), but we don't know how to do that for Query Designer.
    Can anyone help us? Is there any documentation on the subject that we didn't find?
    Thanks,
    Daniel

    Apparently there needs to be some kind of certificate to add.
    Anyone know anything about this?

  • Restricting Query in Query Designer

    Hi All,
    I have to create new report on top of multiprovider which already as other reports on it.
    The report should contain Plant, Billing Document number, Customer Group, customer group1, Ship to, Sold to, Invoice Amount.
    All fileds are available in the multiprovider, all the Ship to numbers are different to Sold to numbers but texts are same for few records. So I need to excule those records where as Ship to texts are equal to Sold to texts.
    Anyone know how to acheive this in Query designer level, where as I can't change anything in multiprovider because we have other queries on that.
    Thanks.

    HI,
    You will have to write a customer exit for this. And logic for this would be : you will have to compare both Ship to texts and Sold to texts and you will have to pull only those records for which Ship to texts are equal to Sold to texts.
    Once you got all the values of Ship to and Sold to for which they are equal (through Customer exit), you can create a variable and put it as a restriction for Sold to or Ship to.
    Regards,
    RJ

  • Problem to achive in Query Designer

    Hi Experts,
    I have following data:
    Y_Flag  <----
    >0sales
        Y       <----
    >10
        Y      <----
    >20
        NA    <----
    >30
    Now i want to show the output as sum of sales amt where Y_Flag =Y (i.e 1020=30) if user selects Y_Flag =Y else i have to show total sales amt(i.e 1020+30=60 ) . How to achive this in Query Designer.
    Please help on this.

    Hi Arminder,
    Thanks for reply, We have around 30+ columns for which we need to apply this condition so
    As per your logic i need to create 60+  RKF (i.e one for Y flag and 2nd for N flag) .
    Is it the only solution or is there any other way where we can achive the solution in simple way.
    Thank you very much for your help.
    Thanks & Regards
    Sameer Khan

  • 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

  • How to write a condition in BEX Query Designer

    Hi
    How can i write a condition in Query Designer
    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    But i char assigment of a condition i find 4 option
    How can i achieve this
    Thanks

    Hi Aurun,
    Thanks for the help,Really appreciated
    As this is my first enhancement using ABAP & CMOD
    What type of key (either Access or developer ) do i require to perform the following  enhancement......so that i can raise request with basis team
    I shall be great ful if u can asnwer below question
    First, you need to create a variable for expiry date with processing type as customer exit, and then give the necessary info.
    In details tab, unchk ready for input as we wont be taking the value from the prompt.
    Now go to CMOD transaction.
    Open the correcsponding project which has the exit code
    (How can i identify the project which has exit code)
    and go to ZXRSRU001 module inside taht.
    Go to the module where u write the exit.
    (How to locate the required module)
    Then, under i step 1, write the code:
    IF I_STEP = 1.
    CASE V_NAME  (What is 'V_NAME',Is it my variable technical name)
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

Maybe you are looking for

  • International characters not showing up correctly in Podcast Title-Is UTF-8

    In the 'Podcast Information' window that pops up, the Episode title is not getting rendered correctly but the details show up fine. Both have chinese characters. Any pointers for resolving this would be appreciated.

  • 5th Generation iPod - with Apple Video cable - can't view it on TV

    Hello, I have a 5th generation iPod and an apple cable to view the video on the TV ... can't get it to work. Have sound but no video, tried adjusting all the video settings nothing working ... Any idea?

  • There's a delay when I hit the record button

    I currently have the MBox2 Factory & I download the drivers for the MBox & I just recently purchased Logic Express. When I hit the record button, I get the pinwheel for roughly 60 seconds before it will start recording anything. Does anyone know why

  • Cannot Sync Mac Air (OS X Mavericks 10.9) to Dropbox

    Sharing is Turned On. Dropbox on Mac is UnLocked. Can See Files in Dropbox Created by Other Devises (Apple and Non-Apple Devices) No Changes Made in Dropbox by Mac are Visible to Any Devise Other Than the Mac. Those Changes Are Not Show on Dropbox.co

  • Leopard 10.5.1 update issue

    I just let Software Update download 10.5.1. After the download, I was prompted to restart - and I let it do so. Now, I have a blue background, with a window titled "Software Update". There is a progress bar, "Installing 1 item", that has progressed m