Calculated quantity evolution in Query Designer

Hello,
I have a few short questions regarding ways of calculating a quantity evolution key figure in Query Designer:
I have a sales figure, let's say an order quantity. I'd like to have it's evolution calculated and displayed (based on another variable with a time period selection) next to it.
- Is there any other way of entering the following formula for the calculation then: (figure A - figure A(N-1)) / figure A (N-1) * 100 ?
- I would like to have a positive sign when this calculated evolution is positive as well as the percentage symbol next to it (eg: +15%). Is there a way to do this?
- Is there a way to automatically fill the time period selection for the variable (using for example a current week - 1)?
Thanks for your proposals.
Best regards,
Olivier

Hi there:
I think i understand what you are asking for. I just did a similar calculation myself after lot of research. Hope i can save you that trouble.
We calculated Change from prior week key figure this way.
In our Open Sales Order Position Report we have Open Order as of a particular day. But users want to know how their open order position changed from last week as of sunday of last week.
We came up with a solution to create an open order position snapshot InfoCube and store the Open Order value in that cube as of every sunday. The data will be delieted every sunday and reloaded via APD from the current open order position InfoCube.
We run a query on the open order InfoCube to get the total open order position based on different characteristics of interest.
Then load it to a DSO with direct update using APD.
Then we load it from this DSO into the prior week infocube.
Then we have a MultiProvider which puts the current open order InfoCube and the Prior Week Open Order InfoCube.
We created a query on this MultiProvider which gives both the current open order position and last week's open order position and we make a cacluation to subtract the two to give us the change from prior week.
If we need a percentage we can calculate from this difference using percentage function.
When we load to prior week open order InfoCube, we use System Date function available in the transformation by formula to calculate the 0CALWEEK to store the week of the prior week data.
In the query i have a key figure for current open position and another key figure for prior week open position each restricted by InfoProvider.
If you are not deleting the prior week data every week, you can add a restriction in the prior week open position as (0CALWEEK -1) so it will always get only last weeks data.
Hope this makes sense.
Good Luck.
MP.

Similar Messages

  • Difference between  aggregation and calculation tab in BEx Query Designer

    HI,
    I am using BEx Query Designer for my report, for the key figures in the coloumn area i slected one numeric key figures, in  the properties tab i found aggregation tab and calculation tab.
    I need to sum up the total values for that particualar coloumn, when i used calculation tab i found to sum all the values for a particular coloumn, then what is the use the aggreagation tab?
    I not able to used that Aggregation tab it is showing as a hidden fields...
    can any one tell me whats the exact difference between these tabs and when we need to use which tab?
    With Regards,
    Thanesh Kumar.

    Hi Thanesh Kumar,
    I moved this thread from forum Data Warehousing to Business Explorer since it is a query related question (as SDN moderator).
    I could explain to you the difference between these two tabs.
    For "calculation" tab, it changes the display of result and does not change the calculation logic.
    It means that, if this key figure is used further in formula, still the original number (without "calculation" tab setting)  is used for further formula calculation.
    For "aggregation" tab, it changes the real calculation logic.
    The system takes the setting as the aggregation rule for records.
    The most common aggregation rule is of course summation. If you set to e.g. Average here, the system does the
    Average instead of summation when aggregating records. And the Average value will be taken for calculation
    in further formulas or other calculations.
    For "aggregation" tab, you could only use it for CKF (calculated key figure) or formula and you could not use it for
    a basic key figure. That should be the reason why you see it greyed-out.
    Regards,
    Patricia

  • Issue with calculating Top 20 % in Query Designer

    Hai
    I am working on Query designer 7.0 where I need to design a report which has 4 parts. The first 3 parts displays the Items with Top 20 Inventory Value with 3 respective divisions for 6 months . Now the 4th part is to display Top 20% of inventory Value.
    So in this report I need to take the Total Inventory and calculate the Top20 % of the items. Hence in this report I need to refer to the top 20 value of 3 divisions. So I cant jus give one condition. So I tried the replacement path for Items with restriction to other queries and created the variables. But I cant use these varaibles in the structures of rows or columns. It gives an error that this variable cant be used in Structure.
    Please do help me in refering the top 20 values of 3 divisions for 6 months and do a calculation to display the % in my 4th report.
    I will assign points for any kind of help provided

    If you can design all those in One query than you can have it...
    It seems now your aim is just to take result for 3 queries and use it in 4th query...
    But if you can figure out defining all 3 Divisions and restriction in Same Query and then put the DISPLAY OPTION = HIDE = do not display
    and then use their result to display you will achieve what you want to....
    for e.g.
    Jan 07-----Feb 07 -
    Mar 07 -
    Dec 07
    Division 1-- Item 1 -
    Inv 1 -
    Inv1.........................DO NOT DISPLAY
    Item2 -
    Inv2 -
    Inv2..........................DO NOT DISPLAY
    Item3 -
    Inv3 -
    Inv3..........................DO NOT DISPLAY
    <i><b>----
    Item20 -
    Inv20 -
    Inv20</b></i>........................DISPLAY ONLY
    Division 2-- Item 1 -
    Inv 1 -
    Inv1......................DO NOT DISPLAY
    Item2 -
    Inv2 -
    Inv2........................DO NOT DISPLAY
    Item3 -
    Inv3 -
    Inv3........................DO NOT DISPLAY
    <b><i>----
    Item20 -
    Inv20 -
    Inv20</i></b>....................DISPLAY ONLY
    Division 3-- Item 1 -
    Inv 1 -
    Inv1</b>.......................DO NOT DISPLAY
    Item2 -
    Inv2 -
    Inv2.......................DO NOT DISPLAY
    Item3 -
    Inv3 -
    Inv3.......................DO NOT DISPLAY
    <i><b>----
    Item20 -
    Inv20 -
    Inv20</b></i>.........DISPLAY ONLY
    THEN you will have result
    Division -
    Jan07 -
    Feb 07 -
    Marc 07
    div1 -
    Total inv/sum(top20) -
    Total inv/sum(top20) -
    Total inv/sum(top20)
    div2 -
    Total inv/sum(top20) -
    Total inv/sum(top20) -
    Total inv/sum(top20)
    div3 -
    Total inv/sum(top20) -
    Total inv/sum(top20) -
    Total inv/sum(top20)

  • Calculated Key Figures in Query Designer - translation

    Hello Experts,
    I created  a few Caclulated Key Figure in the Query Designer. They have a GUID and a text description.
    I would like to know:
    1) How these CKF are represented in ABAP on the system and where I can find them - some database table  ?
    2) If I want the description to be available in many languages how can I handle this ?
    Thanks a lot
    Rado

    Check this
    Tables analysed by analyze_rsz_tables
    Khaja

  • Performing ranking calculations with the BEx Query Designer - ideas?

    I have a scenario where I have a key figure with raw values.  In the column beside this I want to rank the key figures by their raw values.
    Something like this:
    Amount      Rank
       0.11           2
       0.05           3
       0.22           1
       0.03           4
    I can do this no problem using the "Calculate Single Values as:" Ranked List.
    For subsequent calculations I need to perform mathematical operations on the RANK column.    For example say I want to make a 3rd column where I divide the rank by 2:
    Amount      Rank     Rank by 2
       0.11           2             1
       0.05           3            1.5
       0.22           1            0.5
       0.03           4             2
    I cannot figure out how to do this as SAP does not really STORE the values of the rank column for my next calculation.  The "Rank by 2" column actually shows this:
    Rank by 2
        0.065
        0.0025
         0.11
        0.015
    which is dividing the original amount by 2 and not the actual RANK value.
    Anyone have some suggestions on what I can do?

    I know what you are talking about, it will always return 1 or zero which is true or false, I don't think you can do anything much to this. Since, the value of Ranked is getting calculated at runtime.
    thanks.
    Wond

  • CKF in BEx Query Designer

    Hello,
    I have following scenario in Query Designer:
    There is only one characteristic Material in row and 3 calculated Key figures in column Price (Current Year), Price (Current Year -1), Price (Current Year -2). The User gives the current year as Input Variable. It works so far fine.
    Query Output looks like:
    MATERIAL | PRICE (CURENT Y) | PRICE (CURRENT Y-1) | PRICE (CURRENT Y-2)
    1234 |10|20|--
    2345|10||
    3456|12|--|23
    4653|12|13|14
    7564|--|2|5
    6452|||8
    7362||7|
    You can see that at least one value of PRICE Current Year/Current Year-1/Current Year-2 per Material is always filled. All Prices are in EUR.
    Now my requirement is that I have to build a new Calculated Key Figure in Query designer which should calculate the minimum value of PRICE Current Year/Current Year-1/Current Year-2 per Material.
    The new Query Output should look like this:
    MATERIAL | MINIMUM (PRICE CURRENT Y to CURRENT Y-2)
    1234 |10
    2345|10
    3456|12
    4653|12
    7564|2
    6452|8
    7362|7
    I have tried to use Mathematic Function MIN but couldnu2019t get success as few cells are empty. So I cannot use function MIN. When I add empty cell with 0 then the minimum value calculates incorrect. It only works when all 3 cells are filled. How I can solve this problem in Query Designer?
    Many thanks for the help.
    Edited by: Moha Nan on Aug 26, 2011 1:07 PM

    Hi Moha Nan,
    Try this:
    PRICE CURRENT Y *
    ((PRICE CURRENT Y NE 0) *
    ((PRICE CURRENT Y-1 NE 0) * (PRICE CURRENT Y < PRICE CURRENT Y-1) + (PRICE CURRENT Y-1 == 0))
    ((PRICE CURRENT Y-2 NE 0) * (PRICE CURRENT Y < PRICE CURRENT Y-2) + (PRICE CURRENT Y-2 == 0)))
    +
    PRICE CURRENT Y-1 *
    ((PRICE CURRENT Y-1 NE 0) *
    ((PRICE CURRENT Y NE 0) * (PRICE CURRENT Y-1 < PRICE CURRENT Y) + (PRICE CURRENT Y == 0))
    ((PRICE CURRENT Y-2 NE 0) * (PRICE CURRENT Y-1 < PRICE CURRENT Y-2) + (PRICE CURRENT Y-2 == 0)))
    +
    PRICE CURRENT Y-2 *
    ((PRICE CURRENT Y-2 NE 0) *
    ((PRICE CURRENT Y-1 NE 0) * (PRICE CURRENT Y-2 < PRICE CURRENT Y-1) + (PRICE CURRENT Y-1 == 0))
    ((PRICE CURRENT Y NE 0) * (PRICE CURRENT Y-2 < PRICE CURRENT Y) + (PRICE CURRENT Y == 0)))
    replace the NE with the not equal to sign, the post forum doesn't seem to accept thos signs.
    Kind regards,
    Alex

  • Query Designer: calculate relative revenue

    Hi,
    I would like to calculate the relative revenue (= revenue / revenue of the biggest market participant) in the BEx Query Designer. I have a key figure "revenue" and my market participant as characteristic.
    I first tried to create a formula like "revenue / max(revenue)" but this doesn't work that way in Query Designer. I now tried to solve this with a calculated keyfigure but don't come to a solution.
    How can I do a calculation like this in Query Designer?
    Thanks!

    Create a 'Replacement Path' variable having reference to 'Market Participant' characteristic. Use this variable in your formula and use the Max. function on 'Market Participant' variable.
    Hope this helps.

  • Query Designer : Quantity Conversion as per UOM

    Hi gurus,
    I am facing a typical situation here. I have Product Quantity data that I fetch from R3, This has diff UOM based on different product. I know the conversion factor. I have not included the conversion factor in the transformation while loading the data. Hence in the cube, the data is loaded without any conversion.
    Now, in my query, I want that the Quantity data be displayed always in say BOX (Whether at aggregate level, ex. Sales Office level or at a more granular level (product brand level)) it should always be in BOX. Can I make such a modification in my query so that the end result for quantity should always be in BOX.
    thanks n regards,
    Sree

    Hi Sree,
    You can set unit conversion for relevant key figures in the Query Designer.
    For that, you need to create a quantity conversion type first.
    For a BW7.x system, use transaction RSUOM to maintain quantity conversion type.
    It could be defined like this:
    Source unit: from data record
    Target unit: fixed: BOX
    Hope this helps.
    Regards,
    Patricia

  • Percentage calculation on query designer (7.0)

    Hi experts,
    I´m new on Query designer (7.0) and I´m trying to do a finnancial report, so for the lines I create and structure  using G/L accounts and in the columns I got the amount for each level in my structure for a month. Now I´m trying to create an Integration percentage, it specifies how high the percentage in a level is in relation to next higher level but so far I couldn't make it...
    My report must seem like this:
    Structure.............................Amount ...... Int %
    1. Assets................................1000  ....... 100%
    1.1 Current assets....................  600  .......  60%    -> (600/1000)*100
    - Cash.............................  300  ........  50%    -> (300/600)*100
    - Inventories.....................  300  ........  50%    -> (300/600)*100
    1.2 Long-term assets................ 400  .......  40%    -> (400/1000)*100
    - Property, plant and eq..... 150  .......  37.5%  -> (150/400)*100
    - Investment property......... 150  .......  37.5%  -> (150/400)*100
    - Intangible assets..............100  .......  25%    -> (100/400)*100
    I try to use each Percentage calculation options (%, %A, %CT,%GT, %RT) but it didn't work. Can anyone help me in creating a formula to get this percentage?
    Thanks

    Hi,
    check this notes and links to get an overview how to use:
    III. List Calculations (e.g.'Calculate result as..'):Interesting facts about the OLAP Processor/Analytic Engine
    SAP Note Number: [1151957|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31313531393537%7d]
    If, in a structure element (key figure ID), you use the 'Calculate Results as' and 'Calculate Single Value as' properties with their additional fields at the same time, priority problems occur and the system behavior is not immediately clear.:
    Calculate Results/Single Values as ... priority rules
    SAP Note Number: [853058 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d383533303538%7d]
    Regards
    Andreas

  • Question about calculation example with Query Designer

    Hi guys,
    I have to calculate within columns and rows and I am not familiar with the settings in Query Designer that could be done to achieve the results.
    For example:
    Payments----
    Delay -
    Weighted Delay
    1000USD--10 days--
    10000
    2000USD--20 days--
    40000
    3000USD--xxx--
    50000 (this is the sum row)
    The column marked with the xxx is calculated with the sum of weighted delay divided by the sum of payments (50000 / 3000).
    Has anybody an idea how the sum row can be calculated separately?
    Thank you for suggestions!
    Edited by: saplaz on Jul 13, 2010 8:47 AM
    Edited by: saplaz on Jul 13, 2010 9:08 AM

    Hi,
    Assuming you have the Payments Infoobject in the rows and WD Infoobject in the columns; Delay as a formula object.
    > Payments----
    Delay -
    Weighted Delay
    > 1000USD--10 days--
    10000
    > 2000USD--20 days--
    40000
    > 3000USD--xxx--
    50000 (this is the sum row)
    > The column marked with the xxx is calculated with the sum of weighted delay divided by the sum of payments (50000 / 3000).
    You may try this workaround of using
    NODIM( SUMCT(WEIGH_DELAY) / SUMCT(PAYMENTS) )
    on a formula variable. (In this case, the assumption is you have not static type-restricted the rows/cols) If you find any hinderances in the default approach, you may check this out as a formula & insert this at the cell editor level.
    If not, use a simple formula variable; here define the replacement path as 0(N) for your Payments. (N being the # of digits)
    Use a simple calculation:
    SUMGT(WD)/FV
    But you may not get an result o/p in the last row, as the values are not linked (sans relation with Payments). as it will return a X for the delay in the Result row.
    Pls. let me know know if this works or some sample o/p if the initial assumption was wrong.
    Thanks,
    Arun Bala

  • Sap query designer (calculation of profit N-1 from an input year N entered by a user)

    hi,
    on the query designer i have a variable where the user fills in the year N, and In the query i need to calculate a profit of a year N-1 according to a year N entered by the user.
    here is my code abap in exit function where CA_N_1 is my variable BEX customer exit, and YEARN_1 is the variable bex that takes the year entered by a user :
    DATA: LS_T_VAR_RANGE like rrrangeexit,
    LV_CALYEAR type T009B-BDATJ,
    LV_FISCYEAR type T009B-BDATJ.
    WHEN 'CA_N_1'.
    IF i_step = 2.
    READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
    WITH KEY vnam = 'YEARN_1'.
    LV_CALYEAR = LS_T_VAR_RANGE-low.
    LV_CALYEAR = LV_CALYEAR - 1.
    l_s_range-low = LV_CALYEAR .
    l_s_range-opt = 'EQ'.
    l_s_range-sign = 'I'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    a copy of how i defined my variables and my ratio profit_N-1 is attached, when I compile the code with in input 2013 for example I can see that my variable Yearn-1 takes 2012 at the end, but in the query my ratio ^ profit_N-1 doesn't bring anything.
    Please help me i can't find where is the problem...
    Thank you for your help.

    Hello !
    Thks for your quick reply,
    I'm from France sorry for my bed english but i hope u're understanding me, I'm new consultant in BW and like u know woman are not very comfartable with IT so i'm going to ask u 2 others questions about hierarchy and saving query in roles if u don't mind
    1) I want to change some hierarchy node position in production system, do i change directly in rsh1 by adding a node to another level ? or i must to change in a file source or ECC system ? if i change just on rsh1, i will lost all i have changed when Info package will be executed (in daily process chain)...? that's right?
    2) I have a query already published in rôle, but i have to move it to another one, how can i do that in query designer please?
    PS : i can't send you direct message, is it possible to follow me ?
    Thks in advance have a nice day !

  • Quantity is Showing Blank : Bex Analyzer, Source - Bex Query Designer

    Hello Expert SAP BI,
    I Extracting Data from Flat File,
    Till then Cube My Transaction data Loaded Perfectly  ,
    i want to create Report in Bex Analyzer, fetching fields from Bex Query Designer.
    Characteristics are showing in Rows , that showing in Report , but in Columns added Key Figure , its not showing in Report .
    Can any one Suggest , what will be issue and how i have resolve it.
    - Thank you.

    Datasource -> Transformation -> InfoSource
    Infosource -> Transformation -> DSO
    DSO -> Transformation -> Cube

  • Moving avg calculation in query designer

    Hi,
    I know we can do a mov avg in the query designer as " single value " of all the data that is in query.
    How can I get a mov avg for a specific period, say 50 day, 10 weeks or 12 months.
    Can you all help.
    Thanks.

    hi Venkat,
    Can you eloborate your query with an example ??
    Regards
    Raj

  • Where to write IF THEN ELASE statements in BEX Query Designer

    Hi All,
    I need to write a formula in query designer...
    saying that to display the all Quantities in KGs.. Now articles are in Grams and KGs...
    So here i need to perform calculation like... if article is in KGs divide by 1, else if article is in Grams divide by 1000.
    where can i write this logic to perform calculation ...
    Thanks in advance..
    ravi.p

    hi chetan,
    No its not work.. why because i  need to convert the unit of measure in Masterdata Attribute values... that means ) ' 0grooss_wt'.  this is  attribute as a keyfigure of ' 0material' .. this ' 0gross_wt' values has to convert in KGs. at Present ' 0gross_wt' values are in KG and Grams...
    I can change these values in update rules by writting  Routine.. But I need to convert it in KGS at BEX Query Designer Level..
    I need calculate like this
    quantity sold * Gross Weight. 
    here Gross Weight is the formula variable which replacing the values of gross weight...
    i tried by creating conversion types in RSUOM t-code. but it works on keyfigures of infocube.. not on attribute values of master data...
    is there any solution to solve this Problem...

  • Query Designer in BI - How to cumulate value and get the Max and Min value.

    I want to create a report with  query designe of BI 7r. is it possible. the data from the cube will be
    Year ,           Exposed Quantity
    1999 ,             200
    2000 ,            100
    2001 ,            -100
    2002 ,             300
    2003 ,           - 200
    2004 ,             100
    2005 ,            -200
    Calculation should be - Refer the cumulative value field
    Year  ,          Exposure Quantity ,   Cumulative value
    1999  ,            200   ,                             200
    2000  ,            100  ,                              300
    2001  ,           -100 ,                               200
    2002  ,            300  ,                              500
    2003  ,          - 200  ,                              300
    2004  ,            100  ,                              400
    2005  ,           -200  ,                              -200
    An the out put of the report  should be Max value ie 500 and Min Value -200.
    My question is that is it possible to do in the front end ie in the Query Designer (BI 7) If so how.
    Edited by: Parakadavil Chacko Mathew on Oct 8, 2009 3:52 AM

    Hi there,
    Create 4 column,
    1st will show regular values for the key figure,
    2nd will show Cumulative value, in Query Designer, Just right click on the this 2nd key figure properties, calculation tab there you can check on Cumulated option, and define the calculation direction as Calculate along the Column.
    3rd will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as minimum.
    4th will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as Maximum.
    Regards,
    Rajdeep Rane.

Maybe you are looking for

  • How to safely remove all backups from Time Machine/Time Capsule?

    I plan to 'clean up' my Time Machine/Time capsule completely, whereby I want to make it impossible for third parties to recover all or part of these old backups. After I have accompished this I want to start from scratch backing up my Mac. Can you pl

  • Encoding Fails with Media Encoder

    Running Premiere Pro CS6 on a 2009 27" iMac with 3.06 Intel Core 2 Duo and 16 GB Ram running OS 10.6.8. Source video is from a Canon HF100 Camera recording live shows, usually 2 acts. No problem with editing in Premiere but when using Adobe Media Enc

  • Duplex printing on Brother broken update 2.8?

    Greetings. I installed Brother Printer Software Update 2.8 the other day, and now printing duplex on my Brother HL-5250DN doesn't work. When printing a multi-page document, I can see the printer acting as if it was printing duplex (by pulling the she

  • 8310 problems when connecting to computer

    Hi all, I recently bought a blackberry 8310 and love it except that when I connect it to the computer if it gets disconnected it crashes the computer and this is problematic since i can't update the software or anything and can't just take it and go.

  • Solaris 10 as print server for remote Windows

    Fellow SparcMeisters, I'm having problem printing from Windoze XP/98/etc machines to an HPLJ 5000 attached to a SunBlade running Solaris 10. Before upgrading from Solaris 9 to 10 in December, printing was flawless. Now all that prints are line after