Effect of Restricted Keyfigure & calculated keyfigure in query performance

Hi,
         What is the effect of Restricted Keyfigure & calculated keyfigure  in Query Performance?
Regards
Anil

As compared to formulas that are evaluated during query execution, calculated key figures are pre-calculated and their definitions are stored in the metadata repository for reuse in queries. The incorporation of business metrics and key performance indicators as calculated key figures, such as gross profit and return on investment (which are frequently used, widely understood, and rarely changed), improve query performance and ensure that calculated key figures are reported consistently by different users. Note that this approach improves query runtime performance but slows InfoCube or ODS object update time. As a rule of thumb, if multiple and frequently used queries use the same formula to compute calculated fields, use calculated key figures instead of formulas.
RKFs result in additional database processing and complexity in retrieving the query result and therefore should be avoided when possible.
other than performance, there might be other considerations to determine which one of the options should be used.
If the RKF's are query specific and not used anywhere in majority of other queries, I would go for structure selections. And from my personal exp, sometimes all the developers end up with so many RKF and CKF's that you get easily lost in the web and not to mention the duplication.
if the same structure is needed widely across most of the queries, that might be a good idea to have global structure to be available across the provider, which might considerable cut down the development time.

Similar Messages

  • Copying Restricted and calculated keyfigures

    Hi experts,
    is there any way to copy the RKF and CFK for same info provider. i created lot of RKF and CKF but now i need to change the technical name of all of them, is there any easy way other than recreating them??
    Thank You.

    Hi,
    if you don't want to go with Mike's suggestion, and I wouldn't recommend that, there is no way of copying them.
    regards
    Siggi

  • Bad Query Performance

    Hi Experts,
    I have a Query which was built on a multiprovider,Which has a slow preformance.
    I think the main problem comes from selecting to many records from
    I think it selects 1,1 million rows to display about 500 rows in the result.
    Another point could be that the complicated restricted and calculated keyfigures, especially might spend a lot of time in the OLAP processor.
    Here are the Statistics of the Query.
    OLAP Initialization      :  3,186906
    Wait Time, User         :   56,971169
    OLAP: Settings               0,983193
    Read Cache                     0,015642
    Delete Cache                   0,019030
    Write Cache                    0,087655
    Data Manager                   462,039167
    OLAP: Data Selection      0,671566
    OLAP: Data Transfer       1,257884.
    ST03 Stat:
    %OLAP       :22,74
    %DB           :77,18
    OLAP Time  :29,2
    DBTime        :99,1
    It seems that the maximum time is consuming in the Database
    Any suggestion to speed up this Query response time would be great.
    Thanks in advance.
    BR
    Srini.

    Hi,
    You need to have standard Query performance tuning done for the underlying cubes like better design, aggregates, etc
    Improve Performance of Queries/Reports on Multi Cubes
    Refer SAP Note Number: 869487
    Performance optimization for MultiCubes
    How to Create Efficient Multi-Provider Queries
    Please see the How to Guide "How to Create Efficient MultiProvider Queries" at http://service.sap.com/bi > SAP NetWeaver 2004 - Release-Specific Information > How-to Guides > Business Intelligence
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/how%20to%20create%20efficient%20multiprovider%20queries.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef0168d41b6
    Performance of MultiProviders
    Multiprovider performance / aggregate question
    Query Performance
    Multicube performances
    Create Efficient MultiProvider Queries
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b03b7f4c-c270-2910-a8b8-91e0f6d77096
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/751be690-0201-0010-5e80-f4f92fb4e4ab
    Also try
    Achieving BI Query Performance Building Business Intelligence
    http://www.dmreview.com/issues/20051001/1038109-1.html
    tuning, short dumps
    Performance tuning in BW:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef0168d41b6
    Also notes
    0000903559 MultiProvider optimization is only partially active
    0000825396 Performance in reports with many selections
    multiprovider explanation i need
    Note 629541 - Multiprovider: Parallel Processing 
    Thanks,
    JituK

  • How to improve query performance of an ODS- with 320 million records

    <b>Issue:</b>
    The reports are giving time-outs while execution.
    <b>Scenario</b>:
    We have an ODS having approximately 320 millions of records in it.
    The reports are based on
    The ODS and
    InfoSets based on this ODS.
    These reports are giving time-outs while execution.
    <b>Few facts about this ODS:</b>
    There are around 75 restricted and calculated keyfigures used in the query definition.
    We can’t replace this ODS by cube as there is requirement of InfoSet on it.
    This is in BW 3.5 environment.
    <b>Few things we tried:</b>
    Secondary Indices are created on the fields which are appearing in the selection screen of the reports. It’s not worked.
    The Restriction/Calculation logic in the query definition can be moved to backend. Will it make the difference?
    Question:
    Can you suggest the ways to improve the query performance of this ODS?
    Your immediate response is highly appreciated. Thanks in advance.

    Hey!
    I think Oliver's questions are good. 320 Mio records are to much for an ODS. If you can get rid of the InfoSet that would be helpful. Why exactly do you need it? If you don't need you could partition your ODS with a characteristic and report over an MultiProvider.
    Is there a way to delete some data from the ODS?
    Maybe you make an Upgrade to 7.0 in the next time? There you can use InfoSets on InfoCubes.
    You also could try to precalculation like sam say. This is possible with reporting agent or Information Broadcasting. Then you have it in your cache. Look that your cache is large enough. Maybe you can use a table or something.
    Do you just need to make one or some special reports on a special time? Maybe you can make an update in another ODS writing just the result in it. For this you can use update rules or maybe analysisprocess designer (transaction RSANWB) is the better way.
    Maybe it is also possible to increase the parameter for your dialog-runtime rdisp/max_wprun_time (If you don't know, you basis should. Else look here https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ab254cf2-0c01-0010-c28d-b26d04627e61)
    Best regards,
    Peter

  • Calculated Keyfigures Fromm Bex Query into BO without Unit

    Hello,
    We built a Universe on top of Inventory Query from Bex Query Designer. We have Calculated Key figures defined on both Restricted Key Figures and also just as the sum of one or more InfoObjects.
    In the Universe some Standard Keyfigures based off of InfoObjects are shown as folders with Unit value, but the Calculated Key Figures are simply shown as a Measure - it does not have a folder associated that gives the Unit of Measure.
    If we run the same Query from Bex Analyzer all the Calculated Keyfigures have units associated with them.
    Can you please let me know if any of you have the same issue.
    Thank you,
    Jennifer

    Ingo,
    We are using Business Objects 3.1
    Example:  The universe is built off of a Bex Query that is going against the standard MultiProvider 0IC_MP04.  The query has as part of the key figures the following:
    Standard InfoObjects:  0VALSTCKQTY (valuated stock qty) and 0TRANSSTOCK (Stock in Transit)
    Calculated Key Figure:  CKF_INV_QUANTITY.  This key figure is defined as 0VALSTCKQTY + 0TRANSSTOCK.
    When I look at the Key Figures for the universe that sits on top of this query, the two standard InfoObjects have a folder that contains:  1)  Valuated stock quantity (as a measure) 2) Valuated stock qty Unit (as a dimension) and 3) Valuated Stock qty Formatted (as a dimension).  The Stock in Transit is treated the same way.
    However, for the calculated key figure, CKF_INV_QUANTITY, I only see the measure that pertains to the sum of the two fields.  I do not have a unit associated with that value.
    Thanks,
    Jennifer

  • Calculated keyfigures not defined correctly error when executing query

    Hi Experts,
    I changed calculations in the calculated keyfigures and saved successfully.
    when I execute the query in BI7 Bex, I am getting errors like query element not defined correctly in the query. when I look into query in the designer its giving info messages for many calculated keyfigures saying reusable and saving can influence other queries.
    I reverted back the changes but the errors still coming up. I tried to copy the query and run it ..still didnt helped..
    Please suggest me with the solution..
    Quick replies are much appreciated and awarded.
    Thanks
    Vanaja

    Hi,
    The calculated keyfigure is the difference of two other calculated keyfigures...
    I tried to re-drag and drop into keyfigures column and didn't worked and still getting the errors.
    Please suggest some more..
    Thanks
    Vanaja

  • Help needed in creating a calculated keyfigure/query exit

    Hi Reporting Gurus
    Please someone give me a solution for my issue.
    I have two keyfigures
    Plan Finish Date(PFD)
    Actual Finish Date(AFD)
    I have one calculated keyfigure
    Delivery Status = (AFD<=PFD) .  When this condition is met it returns ‘1’ else ‘0’.
    But Delivery Status = (AFD<=PFD)  returns ‘1’  if AFD and PFD both exists and if the condition is met and also works (returns ‘1’) for the scenarios mentioned  below.
    1.     if AFD is blank and PFD is filled
    2.     if AFD and PFD both is blank.
    So I need  a solution for my issue in such a way that
    Delivery Status = (AFD<=PFD)  should return ‘1’ only if AFD and PFD both exists and only if AFD<=PFD.
    For rest of all the scenarios my calculated keyfigure should return ‘0’ , i.e.,
    1.if AFD is blank and PFD is filled
    2.if AFD and PFD both is blank.
    3.if AFD is filled and PFD is blank.
    How to achieve this?
    Should I have to write a customer exit variable and incorporate ABAP codes or should I have to write VB macros or can we have a calculated keyfigure with a necessary logic or is there any other way to achieve it.
    Please help me out.
    Thanks in Advance,
    Have a nice day
    Regards
    Sam

    You can create a new calculated key figure which calculates the result which looks as follows...
    =  ((AFD<>0) AND (PFD<>0) AND (AFD<=PFD)) * 1 + 0
        Please check the syntax when done. You can refer to the below link for more info abt using IF ELSE operations in calculated keyfigures. Please let me know if you come across any issues.
    http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm

  • Condition for Calculated KeyFigure

    Hi everyone,
                          I need to have an additional Keyfigure based on a Condition. For example, If  Staus is Completed , then I need to take  the Net Price as Allocated Price. And if Status is Incomplete , then I need to fill the Net Price as UnAllocated Price.
    So , in this case , I will have 2 Calculated KeyFigures in the Query Designer. One for Allocated Price and the other for Unallocated Price. But how can I restrict t the values based on Status.
    For Example
    Status            Net Price       Allocated Price      UnAllocated Prcie
    Complete          100                   100                       0
    InComplete        200                   0                          200
    1) Is there any way tht  we can avoid displaying Unallocated Price for Complete Status(Since value will be Zero) and Allocated Price for Incomplete Status
    2)Is it better to have these values calculated in END ROutine in the BackEnd.(But this might affect the performance as I require these values only for this Report and I have more than 2 Reports based on the same InfoProvider)
    Thanks and Regards,
    Samir

    Hi,
    Could you please let us know what will be the value of the status field if it is incomplete. Suppose if you have an EMPTY value if it is not complete, you can use the IF ELSE condition with the Boolean operation in the Calculated Keyfigure or Formula as below,
    (Status ==1)* Unallocated Keyfigure + (Status NOT EQUAL 1)*allocated Keyfigure
    If it is not the case then better to handle it at the routine level. Hope this helps.
    Regards,
    Mani

  • Calculated Keyfigures Fromm Bex Analyzer into BO without Unit

    Hi Guys,
    We built a Universe on top of Inventory Query from Bex Query Designer. We have  lot of Calculated Key figures built on Restricted Keyfigures.
    In the Universe some Calculated Keyfigures are shown as folders with Unit value and some of them are not shown in folder and hence it is not bringing the Unit.
    If we run the same Query from Bex Analyzer all the Calculated Keyfigures have units associated with them.
    Can you please let me know if any of you have the same issue.
    Thank you,
    PVK

    Hello PVK,
    I recommend to post this query to the [Integration Kits - SAP|BusinessObjects Integration Kits; forum.
    This forum is dedicated to topics related to the BusinessObjects Integration Kit for SAP.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all SAP Kit queries remain in one place and thus can be easily searched in one place.
    Thanks a lot,
    Falk

  • Using result of a Calculated Keyfigure as input for a Virtual Keyfigure

    Hi experts,
    is it possible, to use the result of a calculated keyfigure of a query for the input of a virtual keyfigure und use the virtual keyfigure within the same query?
    My problem: depending on drilldown, I have a different percentage within the calculated keyfigure. And depending on that value, I would like to read a score out of a DSO and fill a virtual keyfigure with that, and show the score in the same query. In my opionion, the only way to calculate the score is on the fly, depending on the navigation step I do. Maybe there is another approach that I do not know.
    I was glad for any ideas. Thank you in advance!
    Regards
    F.L.

    Hi,
    Sorry but a calculated key figure result cannot be used in a virtual key figure calculation. The reason purely being that the CKF calculations happen after the Virtual KF/ Char calculations (through BAdI or CMOD).
    The only solution i see here is that you will need to do the calculations in the VKF logic itself. Please do remember that VKF calculations and population happens for each record bein fetched into OLAP from the Infoprovider for the Filters put into the report.
    Hope it helps.
    Thanks,
    Abhishek.

  • Problem inText Variable cannot replace 0calmonth in calculated keyfigure

    Hi ALL,
    I am facing a problem while creating text variable for calculated keyfigure saying canot find the replacement for 0calmonth, I have 5 restricted keyfigures individually created a text variable for it. and now i have created  a calculated keyfigure for displaying text using same text variable .
    Could you please tell me what might be the problem.How to rectify .do response urgent plz.
    Thanks much.

    Hi,
    Please find below the code.
    WHEN 'ZMON_TEXT_CE'.   ---Text Variable
           DATA:text2(60),
                 c_calmonth(6),
                 l_month  TYPE /bi0/oicalmonth,
                  t_year(4),
                 zktx TYPE fcktx.
            CLEAR :text2,c_calmonth,t_year.
            LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = '0CALMYL'.  ------user input variable
              c_calmonth  = loc_var_range-low.
            ENDLOOP.
            l_month = c_calmonth+4(2).
            t_year = c_calmonth+0(4).
            SELECT ktx FROM t247 INTO zktx WHERE spras = 'EN' AND mnr = l_month.
            ENDSELECT.
            CONCATENATE zktx '-' t_year INTO text2.
            IF text2 <> ' '.
              l_t_range-sign = 'I'.
              l_t_range-opt = 'EQ'.
              l_t_range-low = text2.
              APPEND l_t_range TO e_t_range.
            ENDIF.
    Hope it helps.
    Regards,
    AL

  • %CT percentage function in Calculated Keyfigure missing

    Hai,
    I want to use the %CT percentage function in Calculated keyfigure.
    But I can only find % and %A function under the PERCENTAGE FUNCTION. Am using BW 3.5. Why is it so?
    Regards,
    Neha Solanki

    Hi neha,
    This will be not available in CK's u have to use formula to get this.. Just try to create the Formula in the querry instead of CK...
    Khaja

  • Calculated KeyFigure Formula

    Hi All,
    I would like to write some code in Calculated KeyFigure Formula,
    I have checked the forums. pls donot include SAP Help URL's.
    Pls explain, if it is possible to write the code...
    Best Regards,
    Pandu.

    Well, not sure if you saw the info here: http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm
    But you can create the IF THEN by using ( ) in the forumla builder:
    Reqt: IF A > B THEN B + C ELSE A
    Formula: (A > B )* (B + C) + (A <= B ) * A
    Each expression in the ( ) is evaluated as True or False and accordingly outputs 1 or 0.
    Hope this helps...

  • Naming convention of calculated keyfigure

    Hi Experts,
    This is the first time we are creating any calculated keyfigure in our system and while creating we are getting authorization error. When we contacted our basis friends they told that its a naming convention issue. I want to know what would be the naming convention of a calculated key figure in our system. Can you please help me how to find this naming convention?
    Thanks in advance for your help.
    Regards,
    Brahma Reddy

    "You do not have authorization to add or create".
    This message purely indicates it is authorization issue. Work with your Basis guys to  get the required access.
    May be some of the roles are not assigned to your user id. or
    In which system you are making changes, if it is prodcution try not to make any changes and make changes in dev system and move to production system.
    Hope this helps.
    Regards,
    Reddy

  • Calculation in Bex Query

    Hello Experts,
    I am developing a report with Bex and I would like to achieve the following:
    I have 0fiscper on the rows and sales amount KF on the columns. When I run the report, I get the following results:
                  Sales
    001/2006      40000
    002/2006      35000
    003/2006      60000
    xxxxxxxx
    Overall Result xxxxx.
    I would like to be able to calculate % sales for each period / cumulative sales YTD * 12 /number of periods. The Overall Result is what gives me the cumulative YTD sales but my question is:
    How can I use the period in the calculation? Any help would be greatly appreciated.

    hi Rue,
    what's no of period here ? total period (12 or 16) ? of total of period displayed like in your sample is 3 period ?
    you can use %GT (percentage of overall result),
    try to create 2 calculated keyfigures,
    one to hold number of periods, and the other for the calculation,
    - if you mean total period displayed, right click 'keyfigures' and 'new formula', give description e.g 'no of period', and type in 1 in formula area
    - 'new formula' again, double click 'percentage of overall result' in percentage function (you will see %GT), and drag 'sales amount' kf to formula area, then 12 * 'no of period', you formula may look like
    %GT 'sales amount' * 12 / 'no of period'.
    to set decimal places, right click the ckf and properties.
    hope this helps.

Maybe you are looking for