Dynamically Selecting a Key Figure at Runtime

I need to develop a 12-month BEx workbook which shows for each record for each month (column): 
1)     <i>Forecast Quantity</i> (key figure);
2)     <i>Actual Quantity</i> (key figure); and
3)     <i>Most Reliable Quantity</i> (somewhere, somehow calculated).
For any given month of data, <i>Most Reliable Quantity</i> is to report either the <i>Forecast Quantity</i> or <i>Actual Quantity</i> based on the month/year of the data and the month/year in which the report is being executed.  More specifically, if the current month/year is greater than the month/year of the data, report the value of <i>Actual Quantity</i>.  Otherwise, report the value of <i>Forecast Quantity</i>.
I would appreciate any suggestions as to how I should go about doing this in BW v.3.10?  (By the way, the report also requires that I present a 12-month total for each of these three quantity types.)

I apologize for taking so long to evaluate and respond to the most recent suggestions.  My boss suddenly pulled me from this project and gave me several higher priority projects.
I took this topic's most recent replies to someone in my company who has more years and depth of experience with BW than I do.  His conclusion (and I concur) is that while some of what is being suggested can be accomplished, it cannot all be pieced together into one complete solution.
So, I have awarded some points to the most recent replies, and I am giving up on accomplishing this with BEx.  Instead, I am going to investigate if there is some way to periodically iterate through the cube updating a new key figure, <i>Most Reliable Quantity</i>.
Thank you for all of the help that was offered.

Similar Messages

  • Selection of key figure(s) from a structure

    Hi,
    I have defined a structure in my query that contains several calculated and restricted key figures. When I execute the query I only want that one (or a selection of) key figure(s) from the structure is(are) available in the report. It is also desirable to be able to select another key figures from the structure at run-time of the query. How can I solve this???
    Thanks and regards
    Eivind

    Hi Eivind,
    why don't you use BEx filter functionality? It allows you to restrict the drilldown to one or more key figures.
    If you are reporting in web browser, you can also create a web template where you select the displayed key figure in dropdown box.
    Best regards,
    Björn

  • "new selection", restricted key figure and basic key figure

    Hi,
    I have a test report and i have a basic keyfigure "ZRevenue" and "restricted key figure"(its defined over "ZRevenue") and
    a "new selection"(its defined over "ZRevenue").
    Now that i have "material number" and "material color" and "request id" in the rows. ("Material color" is a navigational attribute of material number).
    In the column level i have a basic key figure  "ZRevenue" and "restricted key figure"(its defined over "ZRevenue")  and
    a "new selection"(its defined over "ZRevenue") .
    In a "restricted key figure" or "new selection", we can include a basic key figure or new formula or calculated key figure or an already restricted key figure into it, then we restrict it, with one or more characteristic values. In the report output we get KF values only for those characteristic values, with which it has been restricted. Please correct me if my understanding is wrong.
    Initially i restricted the "new selection" (with material number 1 to 3) and "restricted key figure" (with material number 1 to 4).
    In the cube i have material numbers 1 to 11. Now all the values were displayed from 1 to 11, but for the
    "new selection" (with material number 1 to 3) and "restricted key figure" (with material number 1 to 4) i got values only for 1 to 3 and values for 1 to 4 respectively. This is as expected and is working fine.
    Now i tried to restrict the basic keyfigure  "ZRevenue" with material number 1, the output was only until the material number 4 (this is the greatest value of the material number defined over the "restricted key figure").
    Then i tried to restrict the "new selection" (with material number 1 to 9) , then the output was from 1 to 9 material numbers.
    If i remove the restriction over the basic keyfigure  "ZRevenue" , then i get all the material numbers from 1 to 11, for "new selection" i get values for the material number 1 to 9 and for "restricted key figure" i get values for the material numbers 1 to 4.
    Can some one explain me why this behavior?
    Edited by: sapbi enthusiastic on Jan 31, 2012 11:48 AM

    Hi,
    This is where set theory comes in handy
    So what you have is a basic KF (BKF), a selection (SEL), and an RKF.
    When producing an output, BEx seems to be looking for the union of all the restrictions you place on these. So when your BKF is not restricted, the union comes out to everything in the underlying DSO. When you restrict the BKF for material number 1, this is how the restrictions might have been processed internally
    BKF: Restriction on material 1
    RKF: Restriction on material 1-4
    SEL: Restriction on 1-3
    Union of these three: 1-4
    When you remove the BKF restriction and make SEL restricted to 9, this is how it plays out
    BKF: NO Restriction on material
    SEL: Restriction on material 1-9
    RKF: Restriction on 1-4
    Union of these three: everything.
    As the union ends up giving you everything, you get 11 records. However, as SEL is restricted for 1-9, the SEL will have values for the materials 1-9. Likewise for RKF, you'll get values only for materials 1-4. Hope this clears things up!
    Regards,
    Suhas

  • Dynamic Description for Key figure values

    Hi Experts,
    I got a requirement for change the description in  query analyzer.
                  Month    200901                                         200902                            200903
                     qty        value   Past PRICE                qty    value    future price  qty    value    future price
    Material      10         50          5                              7       70           10          7       77           11        
    My requirement is price heading  we need to show current date to previous months header is Past price  and current date to future months we need to Future price.
    Already I tried with two restricted key figures with current montthless than one key figure and currentmonthgreater than one keyfigure. When I using in query both key figure displayed in both sides.
    I want to show past price heading for Less than current month  and future price heading for greater than current month.
    Please let me know any possibilities to show the description dynamically.
    Thanks,
    Chandra

    Hi,
    Here I'm giving sample code this will give the Date and Date-1 and Date-2 based on your Input date ZCDAY.Create 'ZT_DAY' 'ZT_DAY1'  and  'ZT_DAY2'  Text varaibles and use the code.
    In the same way change the code for your requirement.
    TO get the Date (TEXT VAR) based on ZCDAY Input variable***********
        WHEN 'ZT_DAY' .
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              l_s_range-low+0(2) = loc_var_range-low+6(2).
              l_s_range-low+2(1) = '.'.
              l_s_range-low+3(2) = loc_var_range-low+4(2).
              l_s_range-low+5(1) ='.'.
              l_s_range-low+6(4) = loc_var_range-low+0(4).
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDLOOP.
    TO get the Date-1(TEXT VAR) based on ZCDAY Input variable***********
        WHEN 'ZT_DAY1' .
        DATA: ZT_DT1 TYPE SY-DATUM,
              ZT_DT2 TYPE SY-DATUM,
              ZT_SDT TYPE SY-DATUM,
              ZT_YR(4) TYPE N,
              ZT_DY(2) TYPE N,
              ZT_MT(2) TYPE N,
              ZE_TT(2) TYPE N.
              ZT_SDT = SY-DATUM.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              ZT_DY = loc_var_range-low+6(2).
              ZT_MT = loc_var_range-low+4(2).
              ZT_YR = loc_var_range-low+0(4).
          CONCATENATE ZT_YR ZT_MT ZT_DY INTO ZT_DT1.  "YYYYMMDD
          CALL FUNCTION 'DATE_CREATE_2'
            EXPORTING
             i_datum_ein                   = ZT_DT1
             I_KZ_INCL_AUS                 = '1'
             I_KZ_INCL_EIN                 = '0'
             I_KZ_ULT_AUS                  = 'X'
             I_KZ_ULT_EIN                  = 'X'
             I_STGMETH                     = '0'
             I_SZBMETH                     = '0'
             I_TAGE                        =  0
           IMPORTING
             E_DATUM_AUS                   = ZT_DT2.
              l_s_range-low+0(2) = ZT_DT2+6(2).
              l_s_range-low+2(1) = '.'.
              l_s_range-low+3(2) = ZT_DT2+4(2).
              l_s_range-low+5(1) ='.'.
              l_s_range-low+6(4) = ZT_DT2+0(4).
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDLOOP.
    ***TO get the Date-2 based on ZCDAY Input variable***********
        WHEN 'ZT_DAY2' .
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              ZT_DY = loc_var_range-low+6(2).
              ZT_MT = loc_var_range-low+4(2).
              ZT_YR = loc_var_range-low+0(4).
          CONCATENATE ZT_YR ZT_MT ZT_DY INTO ZT_DT1.  "YYYYMMDD
          CALL FUNCTION 'DATE_CREATE_2'
            EXPORTING
             i_datum_ein                   = ZT_DT1
             I_KZ_INCL_AUS                 = '2'
             I_KZ_INCL_EIN                 = '0'
             I_KZ_ULT_AUS                  = 'X'
             I_KZ_ULT_EIN                  = 'X'
             I_STGMETH                     = '0'
             I_SZBMETH                     = '0'
             I_TAGE                        =  0
           IMPORTING
             E_DATUM_AUS                   = ZT_DT2.
              l_s_range-low+0(2) = ZT_DT2+6(2).
              l_s_range-low+2(1) = '.'.
              l_s_range-low+3(2) = ZT_DT2+4(2).
              l_s_range-low+5(1) ='.'.
              l_s_range-low+6(4) = ZT_DT2+0(4).
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDLOOP.
    Thanks
    Reddy

  • Select the Key Figures to be presented in a query before execute the it

    Hi,
    I want to select(through checkbox) the Key Figures to be presented in a query before executing the query. I'm creating BEX queries and web templates (I'm working on BEX 7.0).
    I haven't found clear post about this so if you have implemented something like this please help me and share your solution.
    Kind regards,
    Ana

    Hi,
    If you set a property of your KF as "Hide and can be shown", you will get a filter option for these KFs after executing the report in the navigational block of web report.
    When you click on that filter, you will get the list of KFs, then you can select the desired KFs using check box.
    Regards,
    Yogesh.

  • Dynamic choose which key figure to be showed on query

    Hi, everybody.
    I'm trying to build a query where, based on the user selection (maybe a variable input) the key figure A or B is showed. The key figure, due design requirements, is restricted in several lines inside a structure on query.
    For example, the structure seems like this:
    +Sold Quantity (restricted key figure: 0QUANTITY)
    +Revenue (restricted key figure: 0AMOUNT + DOC_TYPE = 'XYZ')
    +Returns (restricted key figure: 0AMOUNT + DOC_TYPE = 'ABC')
    What I want is, depending on a user input, change the key figure restricted in 2nd and 3rd rows to oher, for example, ZAMOUNT.
    Any tips or any idea if it is possible?
    Thanks,
    Henrique Teodoro

    You can do it by using the basic formula <user input> * 0amount + <user input inverse> * zamount.
    you can create that formula in calculated key figures.
    here the user should be able to enter <user input> only 0 or 1...where 0 will give zamount values ....input value 1 will allow 0amount value to be shown..suppressing the other keyfigure.
    Let me know if its clear ... else i can explain in further detail.
    Award points if useful.
    Thanks
    Sharan

  • Mandatory Variable in Key Figure(new selection) does not give Input Screen

    Hi,
    I have created a query based on a Multiprovider, which uses 0FIGL_C10 & one target DSO.
    In colums I was trying to create one new selection type key figure using 0BALANCE infoobject, restricted it by 0FISCYEAR using one mandatory variable. When I am executing this query fiscal year variable is not asking for any value as input.
    Being it a mandatory variable it should ask for some input, which is not happening.
    Please suggest if I am missing something here or there is some problem with the SAP.
    Regards,
    Lokesh Kumar
    +91 9871097220

    Only making a variable mandatory will not make it input enabled...it should be also " Variable ready for input" then only you will get input screen.
    Rgds
    Amit

  • Virtual key figures problem?

    Hi Gurus,
    what is Virtual key figures? at what scenerio you go for that.
    please guide me ASAP.
    In advance i appreciate you
    RK

    Hi
    Virtual key figures are used when you want to determine the value of a key figure at runtime , the key figure is not populated in the load process ie its value is not stored in the cube. The logic for populating the keyfigures is written in an SAP Exit RSR00002.
    Since the values are computed at run time, it affects the query performance if you have too many VKF or too many records in your cube.
    There is a how to guide on the steps for working with virual key figures/ characteristics.
    To give an example suppose you need an aging report where you want to show how many orders are delayed by 30 days , how many 30 to 60 days and so on based on todays date, So this number needs to change dynamically based on the date the report is run , you could use VKF in this scenario...There might be other ways of doing but just giving an example to explain the concept.

  • Key Figure Sorting in Workbook

    Hi Experts,
    I am creating a workbook where the key figures are supposed to be sorted in descending order. I tried using a Condition the displays the Top 100% of the results (because I want to display all, I just want to sort). The condition is working fine during the first run. However, when I save the workbook and re-open it again, the sort does not work anymore. Please advise. Any help is greatly appreciated.
    Thanks,
    Juice

    Hi Juice,
    Why dont you use the key figure sorting property present in the the Bex Analyzer.?
    Steps:
    1.  In analysis mode, select a key figure cell in the analysis grid and access the context menu. This can be done in 2 ways..
    ○       Choose the cell with your right mouse button (secondary mouse button).
    ○       From the menu, choose BEx Analyzer --> Context Menu for Selected Cell
    2. Choose Properties.
    The properties dialog box for the selected key figure appears.
    On the Sorting tab, you can configure the different sort options for the selected key figure.
    Hope this helps you!
    -Pradnya
    Edited by: Pradnya Rane on Mar 24, 2009 5:20 AM

  • How to use a non cumulative key figure in a multi planning area

    Hi
    I'm new to bps, my problem is
    I need to read the last stock quantity and value at plant and material level to do further calculations in a fox formula, so i made a planning area for the cube 0rt_c36 and another for my tc cube where the results should go, then i combine these areas in a multiplanning area.
    problems arise when selecting the key figure in the ratios tab of the multi area, the ratios 0CPTOTSTOBU (last stock) and 0CPTOTSTOPV (last stock purchase value) are not available, only the inflow and outflow ratios are 0CPTOTREBU and 0CPTOTREPV.
    I know when reporting, the actual value for stock is calculated by  bex, namely, there is no data store at database level, so the question is:
    How to obtain last stock for using in bps??
    thank you for any help
    regards
    A. Garduñ

    Hi Azael,
        In the How to Papers, you will find a Guide on how to take a Sanpshot view of the Stocks(How To Handle Inventory Management Scenarios in BW). Basically if you implement the Guide, you will have another cube called ICSNAP1, which will contain stock quantities /values at the end of each month. You will therefore have to take stock at the end of the last month from that cube and add up the relevant receipts and issues to arrive at the current Stock or Stock as on a particular date.
    Hope this helps!
    Regards
    Sriram

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • Dynamic selection-screen parameters

    Hi All,
    Is it possible to create a dynamic selection-screen checkbox parameters at runtime. My requirement is :
    I have Object parameter on the selection-screen, based on this it has to fetch the info structures and display it with checkboxes on the same selection-screen, so that the user can select which info structures to be processed and can save it as a variant.
    Thanks,
    Satya Priya

    as per ur requirment....execute it and see
    tables :DD02L,t002t,t002.
    data :  begin of itab occurs 0,
                tabname like DD02L-TABNAME,
            end of itab.
            data : tabname1 like DFIES-TABNAME,
            RSSELTEXTS1 type table of RSSELTEXTS with header line.
    data : begin of RSSELTEXTS2 occurs 0,
             RSSEL type  RSSELTEXTS,
             initial type c,
           end of RSSELTEXTS2.
    data : begin of imakt occurs 0 .
           include structure t002.
    data : end of imakt.
    data : begin of ipara occurs 0,
             name(132) type c,
             text(132) type c,
            end of ipara.
    data :srch_str(10) TYPE c,
         tot type i,
         ind type sy-tabix.
    select-options : s_lang for t002-spras.
    *PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
    PARAMETERS showall1 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall2 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall3 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall4 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall5 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall6 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall7 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall8 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showall9 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal10 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal11 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal12 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal13 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal14 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal15 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal16 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal17 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal18 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal19 AS CHECKBOX USER-COMMAND flag modif id sd.
    PARAMETERS showal20 AS CHECKBOX USER-COMMAND flag modif id sd.
    initialization.
    at selection-screen output.
    if s_lang ne ' '.
    select * from t002 into table imakt where spras in s_lang.
    describe table imakt lines tot.
    loop at screen  .
        if screen-group1 = 'SD'
           and screen-group3 = 'PAR'.
               ipara-name = screen-name.
               ind = screen-group4.
            read table imakt index ind.
               ipara-text = imakt-laiso.
               append ipara.
               clear ipara.
        endif.
      endloop.
    endif.
    loop at ipara.
    RSSELTEXTS1-name = ipara-name.
    RSSELTEXTS1-kind = 'P'.
    RSSELTEXTS1-text = ipara-text.
    append RSSELTEXTS1.
    clear RSSELTEXTS1.
    endloop.
    CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
      EXPORTING
        PROGRAM                           = sy-repid
      TABLES
        SELTEXTS                          = RSSELTEXTS1
    EXCEPTIONS
      PROGRAM_NOT_FOUND                 = 1
      PROGRAM_CANNOT_BE_GENERATED       = 2
      OTHERS                            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if s_lang ne ' '.
    loop at screen  .
        if screen-group1 = 'SD'
           and screen-group3 = 'PAR'
           and    screen-group4 > tot.
           screen-input = '0'.
           screen-active = '0'.
         modify screen.
        endif.
      endloop.
    endif.
    if s_lang = ' '.
      loop at screen .
        if screen-group1 = 'SD'.
           screen-input = '0'.
           screen-active = '0'.
         modify screen.
        endif.
      endloop.
    endif.

  • Create variable for key figures

    Hi all,
    I have a query with a couple of key figures, f.e. Net Revenue, Net Sales and Volume.
    Now, I want my end users to have the option to <b>select</b> which <b>key figures</b> they want <b>to see</b>. How to do this?
    All good ideas will be appreciated.
    Thanks in advance,
    Ralph

    Hi,
    You can put your key figures in a structure. A "key Figures" row will automatically appear in your navigation block. If you right clik and select filter value (in BEX) or just click on the filter icon (in 0ANALYZER BW3.5) you will be able to select the key figures to display.
    This should help the user to display and hide the relevant key figures according to their scope of analysis.
    Hope it helps (if so, please assign some points)
    Gili

  • Added new key figure in the report

    Experts,
    I have added new key figure in the report .If i display this key figure value in the report it is populating correct value with ERROR(example 22.5 ERROR).The report is on the multiprovider .i have check the value for this in multiprovider it is populating correctly .There is no calculation in the report for this .While extracting in to report i am getting this. Help me to resolve this issue.
    Thanks
    Murali

    Hi,
    I have already created a formula like NODIM(Key field).that only i am using .
    and mapping I did in this way. I went to multiprovider and I have selected this key figure and right click and select (assign) then I have click on create proposal for all infoobjects option.
    Please suggest any thing need to do.
    I am sorry .I did not understand the lonterm solution suggested by you .what is UOM .Please tell me how to map.can you pls tell me clearly please
    Thanks
    Murali

  • Report Painter - Key Figures in Lead Column

    Hello -
    I am trying to create a report painter report.
    I would like the key figures in the lead column, but right now, I can only choose characteristics.
    Anywho know how to be able to select a key figure in the lead column?
    Thanks

    Hello,
    You have to activate key figure in the library you are using. Use transaction GR22. To activate key figure, juct mark the checkbox.
    Hope this would help.
    regards,
    Jhero

Maybe you are looking for