Formula calculation in BEx

I have a report:
Item//Per1//Per2//Per3
income//25//36//52
costs//21//23//09
adj costs//4//13//8
Now I need a row like the below:
LTM adj costs//25//19//11 (25=4138 i.e. adding all the adj costs from present to last 2 periods) similarly 19 and 11 assuming the previous period adj costs values are 2 and 5.
NOTE: Items are from the structures in the rows and periods are offsets for Posting periods in the column.
How can I calculate or define the LTM adj costs.
Please let me know if I am clear.
Thanks,
Nikki

Hi Nikki,
You will have to create one more structure for the 12 periods..so that you will have 2 structures in the query.
Then you can define exception cells..
Here is the link to the Cell Definitions Explanation..
http://help.sap.com/saphelp_nw04/helpdata/en/f5/1bac3a22f0785ce10000000a11402f/frameset.htm
I have copied the content and pasted it below..
Defining Exception Cells
Use
When you define selection criteria and formulas for structural components and there are two structural components of a query, generic cell definitions are created at the intersection of the structural components that determine the values to be presented in the cell.
Cell-specific definitions allow you to define explicit formulas, along with implicit cell definition, and selection conditions for cells and in this way, to override implicitly created cell values. This function allows you to design much more detailed queries.
In addition, you can define cells that have no direct relationship to the structural components. These cells are not displayed and serve as containers for help selections or help formulas.
Prerequisites
The query contains two structures. You can define exception cells only for queries which have two structures. You can use the one structure for characteristic values and key figures for the other. You can then define cells if these prerequisites have been met.
A cell is the intersection between two structural components. The term Cell for the function Defining Exception Cells should not be confused with the term Cell in MS Excel. The formulas or selection conditions that you define for a cell always take effect at the intersection between two structural components. If a drilldown characteristic has two different characteristic values, the cell definition always takes effect at the intersection between the characteristic value and the key figure.
Procedure
In the Query Designer toolbar, choose Define Cells... to reach the cell definition functions.
New selection
1. Select a cell in the Cell Definition dialog box and, from the context menu, choose New Selection.
2. Define your selection by dragging a key figure and the characteristic values by which you want to restrict the key figure (using Drag&Drop) to the right-hand area of the New Selection dialog box. See also Defining Selections
You can use characteristic value variables instead of fixed characteristic values.
- If you want to change an existing variable, select this variable and, from the context menu, choose Edit. The SAP BW Variables Editor appears. For more information, see Changing Variables in the Variable Editor.
- If you want to define a new variable, select the characteristic value and, from the context menu, choose New Variable. The SAP BW Variables Wizard appears. For more information, see Defining Variables with the Variable Wizard.
3. Enter a description for the selection.
You can use Text Variables in the description.
4. Choose OK. The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell.
New formula
1. Highlight a cell in the Cell Definition dialog box and, using the secondary mouse button, choose New Formula from the context menu.
2. Define your formula using the operands and functions available. See also Defining Formulas
3. Enter a description of the formula.
You can use Text Variables in the description.
4. Choose OK. The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell.
New cell reference
You can use any cell that you define in a formula. If you want to reuse the value from the implicit, generic cell definition that is automatically created at the intersection of the two structural components of a query, select this cell in the Cell Definition dialog box and, using the secondary mouse button, choose New Cell Reference. A description taken from the two structural components now automatically appears in the cell. The symbol shows you that a cell reference exists for this exception cell. You can now reference to this cell. That is, you can reuse the implicit cell definition and do not have to create these values manually in a new selection.
Functions of explicitly defined cells:
Select a defined cell and choose the required function from the context menu (secondary mouse button).
· Edit
· Delete
· Where-Used List
Before you delete a cell, you can check for the formulas in which the defined cell is used in the where-used list.
· Properties
Choose Properties if you:
- Want to change the description of the cell.
- Want to change the highlighting of the cell.
- Want to hide the cell. That is, if you do not want to see the values of the cell.
Help Cells
Choose Help Cells, if you require additional cells for help selections or help formulas. You can use the functions New Selection and New Formula in the context menu to define help cells that are not displayed in the query to serve only as objects for help selections and help formulas.
For example, you can define an invoice in a help cell and use this in a “real” cell to calculate a duplicated invoice.
a. Right-click on the empty cell next to Help Cells to get to a context menu. From here, choose New Selection.
b. Use Drag & Drop to drag the Invoice key figure into the right-hand area of the New Selection dialog box.
c. Enter a description.
d. Choose OK. The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell.
e. From the context menu for the required cell of the query, now choose New Formula.
f. Drag the cell you have just defined, which you can find in the Operands window, under Cells, into the Formula window using Drag & Drop. Click on the button twice.
g. Enter a description.
h. Choose OK. The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell.
In the help cells that are already defined in the context menu, you can:
· Edit the cell definition
· Delete the cell definition
· Display the where-used list for the cell
· Change the description of the cell under Properties.
Result
You have defined one or more exception cells for a query. In the status bar of the Query Designer, the symbol shows you that the query contains exception cells.

Similar Messages

  • Formula calculation showing wrong data.

    Hi All,
    I have an issue in the formula calculation at BEx.
    I have a formula2 whose values is formula1/RKF * Constant.
    formula2=formula1/RKF * Constant.
    Formula1    formual2        RKF             constant
    73.00          25.63            80.00         28
    The error is the actual value of  formula2 to be a
         formula2 = 73.00/80.00 * 28
                      =25.33
    But in report result it is displaying as 25.63.
    for some different values it is showing very different result.
    can any one tell me how to round of this value to avoid confusion
    regards,
    santosh.

    Santosh,
    rounding off the result will not solve your problem. In your scenario, the actual result is 25.33 and rounding it off will be 25.
    Now BI is showing you a value of 25.63 and rounding it off will give you 26. This will still give you the wrong answer.
    You can go to the properties for the formula and in the display properties, you can change it 0 decimal places instead of 2. This is just a interim solution.
    Regards,
    Sameer

  • Bex - Formula Calculation

    HI ,
    I'm trying to display a column that show the 'SHARE' calculation in BEX query.
    Share = (Value by Order / Total Value by Order Group )*100
    <order group>      <order>     <value>     <Share>
    ABC                         31000001     $200     28.57%
    XYZ                         31000005     $400     100%
    ABC                         31000007     $500     71.42%
    Note : In the above, order group ABC , Order 31000001, Share = (200/700)*100
    I'm unable to sum up by order group in query.
    Is there any way we can utilize CKF (aggregation) or anything other method that can be used to populate this column.
    Appreciate help from anyone who's familiar with this.
    Thank you.
    Regards,
    Maili
    Edited by: Maili06 on Mar 31, 2011 6:07 AM

    HI Divyesh,
    I'm using an alternative approach. This manage to solve my issue.
    I'm using SUMCT function in BEX.
    I create :
    Formula 1 --> formula sumct(Value)
    Formula 2 --> (Value / formula 1)*100
    Formula 2 provides the share percentage for me.
    I placed the Order group as the first column.
    You may find abt sumct here :
    http://help.sap.com/saphelp_nw04/helpdata/en/03/17f13a2f160f28e10000000a114084/content.htm
    http://www.scribd.com/doc/46732230/SAP-BI-Reporting
    hope it helps you to solve your prob.
    Regards,
    Maili
    Edited by: Maili06 on Apr 1, 2011 11:52 AM

  • Calculations Translation- Bex vs Transformation

    Hello gurus,
    here is the line that I d like to translate in BW, and I d like to know what's the better way of implementing it in BW, is it in Transformation (formula/calculation), or in Bex.
    result = (1/3) x (sum of prior 3 month balance from date entered) x (number of days in the past 3 months) / (sum of prior 3 month sales)
    Assumption is that user 's input is 1 Month period. (please write the line in abap if you re thinking that it is easier).
    Thanks,

    Hey Suhas,
    i have this code below, but  I am the call fm get days in Month return 0, what do you think is the problem?
    (i am operning a new thread although it is a continuation for this one here:
    Customer Variable to return number of days previous months )
    DATA: l_s_range TYPE rsr_s_rangesid.
    Data: noOfdays type i,
          date_prev1 type /OSP/DT_DATE, date_prev2 type /OSP/DT_DATE,
          date_prev3 type /OSP/DT_DATE,
          var_yr type n length 4,
          var_mth type n length 2, var_mnth_prev1 type n length 2,
          var_mnth_prev2 type n length 2, var_mnth_prev3 type n length 2,
          var_day type n length 2,
          ev_days_prev1 type /OSP/DT_DAY,
          ev_days_prev2 type /OSP/DT_DAY,
          ev_days_prev3 type /OSP/DT_DAY,
          I_NUM_DAY type n length 2,
          loc_var_range LIKE rrrangeexit.
    CASE i_vnam.
    WHEN 'Z_F_RETURN_3MONTH_DAYS'.
      IF i_step = 2.
        LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZC_PERIOD_SR'.
        CLEAR: var_mth, var_yr, var_mnth_prev1, var_mnth_prev2, var_mnth_prev3.
        CLEAR: date_prev1, date_prev2, date_prev3, ev_days_prev1, ev_days_prev2, ev_days_prev3.
        var_mth = loc_var_range-low+5(2).
        var_yr = loc_var_range-low+0(4).
        var_mnth_prev1 = var_mth - 1.
        concatenate var_mnth_prev1 '01' var_yr into date_prev1.
       var_mnth_prev2 = var_mth - 2.
       concatenate var_mnth_prev2 '01' var_yr into date_prev2.
       var_mnth_prev3 = var_mth - 3.
       concatenate var_mnth_prev3 '01' var_yr into date_prev3.
        CALL Function '/OSP/GET_DAYS_IN_MONTH'
        exporting IV_DATE = date_prev1
        importing EV_DAYS = ev_days_prev1.
        I_NUM_DAY = ev_days_prev1.
       CALL Function '/OSP/GET_DAYS_IN_MONTH'
      exporting IV_DATE = date_prev2
       importing EV_DAYS = ev_days_prev2.
       CALL Function '/OSP/GET_DAYS_IN_MONTH'
      exporting IV_DATE = date_prev3
       importing EV_DAYS = ev_days_prev3.
        noOfdays = ev_days_prev1 + ev_days_prev3 + ev_days_prev3.
        l_s_range-low  = noOfdays.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'EQ'.
        append l_s_range to e_t_range.
        ENDLOOP.
      ENDIF.
    ENDCASE.

  • Ad Hoc Formula Definition in BEx Web

    Hello,
    I´m searching how to use the smart-input / AdHoc Formulas within the BEx Web (in BEx Analyzer it is not a problem).
    I found following statement:
    http://help.sap.com/saphelp_nw70/helpdata/en/a4/eb1442be645133e10000000a155106/frameset.htm
    Release 7.0 Support Package Stack 14
    I got exactly this system status in my test system, but I could not manage to execute the adhoc formula feature in a query (I don´t have the context formula within calculations and translations) - like it is described here:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/0a20fc60585bebe10000000a1553f7/frameset.htm
    Is there something else I got to take care of? Some system setting? Also I got the SAP GUI 710.
    Can anybody help me?
    Best Regards,
    Sandra
    Edited by: Sandra Schmidbauer  on Jul 1, 2008 5:57 PM

    Hi,
    I just found out that there is a different in step 5 of the Define Exception Wizard between an ad hoc exception created in BEx Web Analyzer and an exception created in Query Designer.
    Step 5 is to set characteristic restriction.
    I was not aware there is a different between exceptions created in Query Designer and BEx Web Analyzer.
    Exception created In Query Designer: In step 5, it stated that "For all characteristics, the exception has no restrictions as long as none of the following settings are selected"
    Ad hoc exception created In BEx Web Analyzer: In step 5, it stated that "For all characteristics, the exception affects only the results as long as none of the following settings are selected"
    If you have filters applied to some characteristics that are not drill down/across in the query result, you must include them in the characteristic restriction of the exception.  Otherwise, the query result will not be affected by the exception.
    E.g., Drill down by Plant, filter Fiscal Year by 2008.
    In step 5 (of ad hoc exception), must include both Plant and Fiscal Year in the characteristic restriction.

  • Formula Calculation in Recipe Management

    Hello All,
    I am using a Z_PACK Packaging spec (of category Packaging) as a component inside a Formula. The spec is used in BOM in 'Grams' even though it is packaging and not in EA. I dont want to include this packaging spec in any of the following formula calculations related to Ingredients (ii) Quantity (iii) Composition but only want to make it relevant for (iv)Costing View.
    How do I achieve this. What configuration I need to do to make it work.
    Thanks,
    Sachin

    Hello Sachin,
    Please check the possibilities of the IMG activity 'Specifiy Events'.
    Example: event EVT_EXPL06 (Explosion: List of Ingredients (Specifications)) for the Ingredients view and component Z_PACK for packaging. With the indicator Explosion and Calculations it is possible to control the usage.
    Please have a look into the documation of the IMG activity.
    Best regards,
    Roland

  • What is available in essbase to show analysts formula calculations for accounts/ratios?

    Hello all,
    What is available in Essbase to show analysts formula calculations for accounts/ratios?
    Access to the EAS console is not an option, so we are looking for something else.
    Also what is best practice for use of a “Data Dictionary” for Essbase reports/database.
    Thanks,

    See this discussion.
    https://forums.oracle.com/message/11201356#11201356

  • Formula calculation not work, when one inspection characteristic was set by formula

    In the inspection plan, set 0040 charac. "calc. charac." in control indicators, and the formula is "15.86/C0020*100".
    when the inspection lot was created, the 0040 charac. could be edit, and the formula title  "formula calculation not by SAP interpreter".
    However by the same basic data in QAS system,the formula title is "formula calculation by SAP interpreter", and the charac. couldnot be edit, only be claculated by the system.
    Anybody know why this error occurred?
    this  is the question in PRD system,
    this is the right situation in QAS system

    Hi Pei,
    Please can you check the characteristic value using C00020 (C0 then 2 zeros before 20. Total 3 zeros before 20) instead of C0020 and check if this is working.
    You can take some clues form the below thread -
    http://scn.sap.com/thread/1672782
    Thanks to all previous contributors of the attached thread!!
    Thanks,
    Arijit

  • FRM-40735: Formula-CALCULATION trigger

    Hi,
    I'm getting this error in my form....
    FRM-40735: Formula-CALCULATION trigger raised unhandled exception
    How can I find where the issue is? Can you please suggest some ideas?

    I have the following 6 formula columns in my form....
    1. PCT_COND_COMP_FORMULA -->
    (:CLT.DUCT_LENGTH_ACTUAL / :CLT.TRENCH_FT_EST) * 1002. ACTUAL_COST_FORMULA -->
    nvl(:clt.unit_cost,0) + nvl(:clt.te_cost,0) + nvl(:clt.paving_cost,0)3. CSOA_AVG_COST_TRENCH_FT_AVG -->
    :CR_ACCOUNTS.CONDUIT_COST_TO_DATE_SUM / :CR_ACCOUNTS.CONDUITS_COUNT4. COST_TO_ACCRUE_FORMULA -->
    ((:cr_accounts.completed * :cr_accounts.unit_price) * (nvl(:clt.residue,100)/100))5. CWE_FORMULA -->
    :cr_accounts.accrual + ((:cr_accounts.est_quantity - :cr_accounts.completed) * (:cr_accounts.unit_price))6. COST -->
    :CR_ACCOUNTS_DETAIL.UNIT_PRICE * :CR_ACCOUNTS_DETAIL.QUANTITY1. POST-TEXT-ITEM trigger on ESTIMATE_CUSTOM item has....
    BEGIN
    if get_block_property('cr_accounts', update_allowed) ='TRUE' then
         IF NVL(:CR_ACCOUNTS.EST_QUANT_CUSTOM,0) <> 0 THEN
              :CR_ACCOUNTS.UNIT_PRICE_CUSTOM := (:CR_ACCOUNTS.ESTIMATE_CUSTOM / :CR_ACCOUNTS.EST_QUANT_CUSTOM);
              update_nonprano;
         END IF;
    end if;
    END;2. Procedure update_nonprano ...........
    PROCEDURE update_nonprano IS
    BEGIN
    :CR_ACCOUNTS.COMPLETED := (:CR_ACCOUNTS.PCT_COMPLETE_CUSTOM/100) * :CR_ACCOUNTS.EST_QUANTITY;
    -- sets cost_to_date
    :cr_accounts.cost_to_date := ((:cr_accounts.estimate_custom) * (:cr_accounts.pct_complete/100)) ;
    -- sets cost_to_accrue
    :cr_accounts.cost_to_accrue := (:cr_accounts.cost_to_date) * (nvl(:CLT.residue, 100)/100);
    -- sets accrual
    :cr_accounts.accrual := (:cr_accounts.cost_to_accrue) + NVL(:cr_accounts.adjustment, 0);
    -- sets CWE per ACCOUNT
    :CR_ACCOUNTS.CWE := :CR_ACCOUNTS.CWE_FORMULA;
    -- sets CWE
    :CLT.CWE := :CR_ACCOUNTS.CWE_SUM;
    IF :CLT.PCT_COMP = 100 AND :CLT.CWE > :CLT.ESTIMATE THEN
         WARNING_ALERT('The Layout Complete is set to 100% but the CWE is larger than the Estimate.  This job is incomplete and over budget.  Please modify % Layout Complete.');
    END IF;
    END;Now in my form when I enter EST_QUANT_CUSTOM= 12, ESTIMATE_CUSTOM=13, PCT_COMPLETE_CUSTOM=15... I get error.
    But when I put EST_QUANT_CUSTOM= 12, ESTIMATE_CUSTOM=12, PCT_COMPLETE_CUSTOM=12... I don't get error.

  • Formula calculation doubt ?!

    Hello ,
    Can we make a database item in a form store a formula calculation ..?
    :ITEM_QTY * :ITEM_PRICEor we have 2 make it displayed...!
    Regards,
    Abdetu...

    An item in a Data Block does not have to be displayed/visible in your form in order to stored/hold a formula calculation value. Create a test form which displays the calculation field initially so you know it is working correctly. Then set the "Canvas" property to NULL for the item and add a button that displays the value of the non-displayed calculated item in a Message(). When you click the button, you will see the value displayed! ;-)
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Oct 29, 2010 8:48 AM

  • YTD calculation from BEx is not working in Advance Analysis for OLAP/OR Office

    I have AA for OLAP based on BEx. There are YTD calculation in BEx Designer: User enters Period in variable, and in user exits, the Period Range is populated as "1 ~ UserEnteredValue" in second variable. In BEx, YTD is calculated based on the Restrictive KF for the period range, calculated in User Exit. This is working fine in BEx Analyzer, however in Advance Analysis (for OLAP OR in Ofice), the YTD value is not coming up they way it is in BEx Analyzer...
    Anybody has any clue, why??
    Thanking all of you in advance  

    Hello Sharma
    If something is working for BEx Analyzer but not for Analysis OLAP or Analysis Office then this typically (but not always) indicates an issue with the BICS (BI Consumer Services) component.
    I would suggest you contact support about this so the appropriate logs can be captured and the issue investigated by the BICS team.
    Regards
    Ian

  • 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.

  • Formula Problem in BEx

    Dear All,
    I am using BEx Query Designer to make a query.I view the report using browser. I have 2 keyfigure fields "price" and "forecast quantity". I have to arrive at "forecast Value" = price * forecast quantity using formula in Query designer. Although for each material this proves correct in report material wise. If I see the report customer-wise a customer who has bought 10 materials first the prices are added up andthen the forecast quantity is added up and then the sums are multiplied to get forecast value which is wrong.
    Illustration :
    For Customer 1 :
                    Quantity    Price     Value(Quantity * price)
    Material1   | 2           | 10        | 20
    Material2   | 3           | 10        | 30
    Material3   | 5           | 10        | 50
    Material4   | 7           | 10        | 70
    Total         | 17          | 40        | 170 = Correct value
    But if I see report customer wise I get the value as 17 * 40 = 680 which is wrong.
    Is there any way when I see an aggregation of materials the calculation in formula column first multiplies individual rows and then add the rows to give me final value?
    Regards,
    Ratish
    [email protected]

    Hello ,
               Right click on the calculated key figure select properties enhanced and change to Before aggregation , now the result is calculated correctly.
    But if you use before aggregation, the cubes aggregates are not used, so this will have negative effect on performance , this property is applicable to query level key figures.
    hope it is clear
    assign points if useful

  • How to add % symbol to a KF calculation in Bex

    Hi
    I am using my own formula for % Calculation in a Bex Formula (Not using an standard % functions)....Is there any way that i can insert % symbol to the result displayed in the report
    Thanks

    Hi ,
    Yes you can use a workaround by crating a new formula (F1)  based on your formula ( F2) such that
    F1=F2 %A 1
    Hide F2 and disply just F1 in your report.Using the above formula you are deceiving your formula to just display its value as a percentage of 1.
    This will solve your issue.
    -Mayuri

  • What is a formula variable in bex

    hi friends,
      can anybody tell me about what is a formula variable. how can we use formula variable. give me one simple example. thankk u.
    thanks,
    sree

    Hi..
    Here is the sap link which will gives u the best about variable...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/0a/cd6e3a30aac013e10000000a114084/frameset.htm.
    Here is some examples  how u can use formula variable...
    1) If u want to multiply the key figure in the data target(DSo or CUBE) with an attribute of masterdata which is used in the Data target.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc.
    2)caliculating the aging.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/a-c/calculating%20the%20ageing%20of%20the%20materials.pdf
    3) the difference in the dates at the query level
    Re: Calculate no.years/months/days in Bex formula
    Regards....KP
    Edited by: kundan.sap on Jul 3, 2010 5:41 PM

Maybe you are looking for

  • Satellite C855D-S5110 not copyright windows 8

    update error , my system not use windows 8 of Toshiba's Laptop. Please , help me

  • Excluding Additional Charges Paid from Party Dues

    Hello There is a requirement where a special charge has been paid during invoicing. this has to be added in invoice or GRN. The amount will not be in the party's account due but should be included in item valuation as cost. To explain in detail - A/P

  • How to display DVD timecode to the frame level?

    I know you can advance frame by frame with (assumes DVD object is called "mydvd") member("mydvd").frameStep(1) but.......how do see what frame you see the frames in the DVD controller object? The DVD object only shows to the nearest sec it seems. Can

  • URG: ORACLE ERROR 6502 IN FDPSTP IN PICK SELECTION LIST GENERATION

    Dear All, I'm on 11.5.7 on Linux. My problem is with WSHPSGL: Pick Selection List Generation that ends with error when launched from transactions form. The program end with the following error: Oracle Shipping: Version : 11.5.0 - Development Copyrigh

  • 1080i or 720p

    Hi, I've recently purchased the ATV and it's connected to my Samsung HDTV via HDMI. I've got a 720p TV, that also supports 1080i, but I want to know which resolution setting will give the best performance. Any advice?