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.

Similar Messages

  • Variable to store a result of a complex calculation in bex query

    Hello all,
    I've got a query in BEX with some key fields to display and also need to perform some calculations not supported in bex formulas.
    I think this could be made in a BEX user exit and I'm trying this by creating a project in CMOD assigning EXIT_SAPLRR0_001... Working with INCLUDE ZXRSRU01 and so on.
    I just want to know if this is possible this way because I execute my query and the variable created never get any value at runtime.
    Could anybody help me or give an idea on how to use BEx user-exits?
    Thank you very much,
    Carlos Hinestrosa.

    Hi!
      I think it should work .here are some links to help topics on using user exits.
    presentations
    https://websmp206.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700005475091999E
    Help:
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
    propably they might help you
    With regards
    Ashwin

  • % Calculactions in Bex Query Designer

    Hi Experts,
    Could you please on how can i perform the below % Calculactions in Bex Query Designer.
        Vendor No line item Not = L category =A  status =RFQ :for items
    Example : I have 8 items for vendorNo 200274 and only 4 as above condition and 5 items as not L(delete)
    requament: % RFQ Without Response:
    Percentage of Quotation response ={(No. of RFQReponses Received/ No. of RFQ items sent)*100},
                                                                   ( 4/5 * 100= 80%)
    Percentage RFQ without response= 100 -  Percentage of Quotation response
                                                                  =  100-80 = 20%
    How can i perform the % Calculations in Bex Query Designer.
    Vendor
    Purchasing document
    Indicator: Line Item
    Purch. doc. category
    Purch. doc. status
    Item
    Number of Records
    category A item L
    200274
    V-LINE EUROPE EXPORT MARKETING
    6000003778
    L
    A
    Not assigned
    10
    1
    20
    1
    30
    1
    6000003779
    Not assigned
    A
    Not assigned
    40
    1
    9000000046
    Not assigned
    A
    RFQ
    10
    1
    1
    20
    1
    1
    30
    1
    1
    40
    1
    1
    Result
    8
    4
    thank you

    Hope you have done some groundwork you have done on this requirement. Have you tried to create New Formula and put the required formula in it to calculate Percentage of Quotation response ?
    Your formulas seems to be straight forward.
    Keep in Filter: item Not = L category =A  status =RFQ
    You may start working on it and get back with if you are struck.

  • 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

  • Calculated Key Figures Corrupted in a BEX Query

    Hello SDN's,
    We are facing an weird issue in BEX Query. As part of Enhancing the query, We have created a new CKF and added in the Columns for the required CKF. It prompted for a Transport request and saved the Query elements for more than hour. Now the Query is throwing an Error messages where in more than some 30 CKF's got corrupted. When i check the CKF definition for all the corrupted key figures there is not Formula or Calculation.
    Below is the message which we can see in the BEX query for Corrupted Calculate Key Figure.
    Diagnosis
    Element ' XXX ' cannot be analyzed by the analytic engine without a definition.
    System Response
    Without a valid definition, the element will be ignored by the analytic engine.
    Procedure
    Provide a valid definition for element 'XXX'.
    Could anyone please help me to retrieve query back to normal ???. Your are inputs are appreciated
    Thanks,
    HA

    yo could try rsrt in bw and try to regenrate the query thats all i got. .otherwise always make a copy before you start working on a query. if it still is coruupted then you will have to recrate it. if the query is in your bwq maybe the basis can do a transport( not recomended)back. good luck..

  • Bex Query - Specific calculation in query result

    Hi experts!
    I've received a requirement and I cannot find any way to delivery it using the stantard operation or configuration into Bex Query.
    We have a query which have three KF with summarization in result. The new requirement is based in the KF "POND" to change the calculation in the result. Below are the actual result and the expected result.
    The actual query result.
    Line
    OP
    QTD
    TMP
    POND
    A1
    1614073
    702
    19
    13338
    Total A
    702
    19
    13338
    B1
    1587949
    840
    235
    197400
    B2
    1610938
    4.240
    28
    118720
    Total B
    5.080
    263
    316120
    Total A + B
    5.782
    282
    329458
    The expect result based on the new requerment
    Linha
    Ordem de Produção
    QTD
    TMP
    POND
    A1
    1614073
    702
    19
    13338
    Total A
    702
    19
    19
    B1
    1587949
    840
    235
    197400
    B2
    1610938
    4.240
    28
    118720
    Total B
    5.080
    263
    62
    TOTAL A + B
    5.782
    282
    57
    Check out the "Total A" result for KF "POND", the new calculation is the sum of KF "POND" divided by the sum of KF "QTD" (13338 / 702 = 19)
    The same to "Total B" result for KF "POND", the calculation is the sum of "POND" divided by sum of KF "QTD" ( (197400 + 118720) / (840 + 4240) = 62).
    I've been using all recourses into Bex query, but I've haven't found any way to deliver this requirement, though.
    I'd really appreciate if anyone could give me some suggestion to deliver this requirement.
    Thank you.
    César Sevilha.

    Hi Suman!
    Thanks for your replay.
    The collision options wont help me because I have calculation on the same structure.
    I need to keep the division POND by QTD in the result. Check out the table below.
    The Formula Bex Query (POND / QTD) is a simple division between  KF POND by KF QTD, the result
    is a totalization of lines A and B.
    The requirement is to keep this division on the result. Check out the column Requirement, this is the result expected.
      Line
      OP
      QTD
      POND
    Formula
    Bex Query (POND / QTD)
    Requirement
    A1
    1614073
    702 KG
    13.338 KG
    19 KG
    19 KG
    Total A
    Result
    702 KG
    13.338 KG
    19 KG
    19 KG
    result (POND) divided by result (QTD)
    B1
    1587949
    848 KG
    197.400 KG
    233 KG
    233 KG
    B2
    1610938
    4.318 KG
    118.720 KG
    27 KG
    27 KG
    Total B
    Result
    5.167 KG
    316.120 KG
    260 KG
    61 KG
    result (POND) divided by result (QTD)
    Total A + B
    Result
    5.869 KG
    329.458 KG
    279 KG
    56 KG
    result (POND) divided by result (QTD)
    I'd like to know how to keep the division in the result.
    Example:
    The result of Total B should be 61 kg which is the result of division between the result of KF POND (316.120) by the result of QTD (5167).The currently formula has as result the totalization  of B1 and B2.
    Thank you in advance.
    César Sevilha.

  • Bex Query- Use of ABAP code in Calculated Keyfigure/formula

    Dear Experts.
    I am wondering if there is any way to use ABAP in the formula editor of the Bex Query desinger.
    I have to build a report with very complex formulas (a lot of key figures, comporations, If then else ) an I think it would be easier to build all then in ABAP.
    So what I am looking for is any kind of user-exit/Badi that allows to calculate a Calculated Key figure/fomula in ABAP with the same data that is availabe in the fomula editor.
    If SAP is not providing this, this is clearlly a must for next releases.
    Thanks a lot and best regards,
    Alfonso.

    Dear Ananda.
    Thnaks for your reply, but could you please extend your answer a little bit more?
    As far as I know, Formula customer exit variables are only called once and they don´t provide the rest of the keyfigures and characteristic use in the drilldown level, so for my needs they are useless.
    Regarding IF-then-else statement in the formula, I already know about it. Actually what I am trying to avoid is to use them. In order to build my query I might need to build really big formulas with a lot of If-then-else, making it quite complex what the formula is doing. This is the reson I want to do it on ABAP.
    Please any other ideas?
    Thanks a lot.

  • 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

  • Count and Percentile calculations for various Lines in BEx Query.

    Dear Experts
    I working on a BEx Query at the moment and the output is required in the format below:
    This and another report (which will be displayed above this report) will go into a WAD eventually.
    I have Key Figure for 'Document Count' but not sure how to get the percentage displayed in the second line and also for the Top 3 Reason Codes (not having anything displayed across 'Top 3 Reason Codes' though). I have tried Selection and other ways but nothing worked so far.
    Do I have to use Cell Editing by any chance or is there a way to work-around this.
    Thanks in advance for your help.
    Kind regards,
    Chandu

    You can achieve your report format by creating a Structure in rows with Cell definitions. Define each cell in COunt Document KF according to the row logic.

  • Headcount Calculation in WebI via BEx Query

    Hi All,
    My WebI report is through the BEx Query.
    For the headcount data to be shown in report the value is comming rite for month i.e., 900 but when for year count it is showing as 500. but technically for headcount the value should populate as "900" again.
    The formula i used was (count distinct employee).
    The cube used here is standard bw headcount cube.
    Please let me know about any work around for this.
    Thanks,
    Vijay

    Hey Carly,
    thanks for your suggestion.
    I actually search for notes, but found non relevant for our system. The BW notes can actually be implemented as there is an "embedded" BW server, but it's release seems to be high enough.
    I don't think the query is "hanging". The "loading" popup stops after a few minutes and then simply shows the "empty" entry with an updated timestamp under BEx documents. We don't receive any errors.
    Not too familiar with "tracing" within BO, but I'll give it a try (after doing some research and consulting some (ex-)colleagues). I have asked to "update" our front end tools too, as we're rather "low" (and have some Dashboard issues as well). So, since it's already (late) Friday afternoon here, I might just wait on that update (almost time to start my weekend).
    Cheers,
    Raf

  • Division in bex query designer

    Hi experts,
    I have a strange problem in bex query designer. I am trying to calculate margin in % but the calculation gives the wrong result.
    The two figures I try to calculate are -25124 and -91248 (figures in 1000 NOK)
    The result should be (-25124/-91248)100 = 27,53* (when formula entered in excel)
    I have tried the following in Bex query designer
    -25124 %A -91248 = -0,02753%
    (-25124/-91248)*100 = 0,02753
    What might be the problem here?

    Thanks again for your answer,
    I will try to explain my report (requirement from the business user)
    Actual (KF)----
    Budget (KF)       
    Sales-- -91248--
    -77153         
    FSP-- -25124--
    -18918
    Margin  % -
    (FSP Actual/Sales Actual) 100---(FSP Budget/Sales Budget)100
    Dim
    Dim
    Result
    The margin is calculated in the cells in the bex query designer to differentiate between actual and budget. There is no option to calculate the margin in the columns as this would influence all other rows aswell.

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

  • Usage of formulas in conditions in BEx Query Designer

    Hi guys,
    does anybody of you guys know, if it's possible to use the results of formulas in conditions? I tried it, but the result of the query was "No applicable data found", but there are data for the selection.
    When I'm defining the condition with the key figure (no restricted or calculated key figure), then the query can be executed.
    In my case, I like to define a condition based on a formula result. The value should only be displayed, when the result is greater than 30.
    Any ideas or are there any bugy in the BEx Query Designer?
    Thanks a lot + best regards,
    Clemens

    Hi Clemens,
    I have created a condition in my own system based on formula and it works perfectly fine. Please check following points in your condition change mode,
    1) Condition is marked as Active.
    2) In the block "Evaluate condition below for" you will have to select "All characteristics in drilldown Independently". If you have selected combination of characteristics then you will have to maintain proper sequence otherwise your condition will not work.
    3) In the next block when you set the condition, click on new, in the first block select your Formula from dropdown and set the proper operator in your case you will have to select "Greater than" in the next column set the value of key figure and just trasnfer it.
    Now you are ready to use the condition.
    Regards,
    Durgesh.

  • IF ELSE Statement in BEx Query based on the results

    Hi experts,
    I want to realize the following IF/ELSE statement in a BEx Query in respect to the result values
    If the result of KF1 equals 0, than set the KF2 to 0, Else (KF1 NE 0) show the value of KF2
    Background: I want to report the order backlog. In the example above we have an incoming order value of 23.700,80 EUR in periode 12.2013 and an turnover of 22.370,80 EUR in periode 01.2014. The order backlog in ST (KF1) is 1 ST (12.2013) - 1 ST (01.2014) = 0 ST. The order backlog in EUR (KF2) is 23.700,80 EUR (12.2013) - 22.370,80 EUR (01.2014) = 1.330 EUR. The Order and Invoice is finished, but we have an positive order backlog in EUR (reason: less turnover as incoming order).
    For this case I want to realize the IF/Else statement to check if the oder backlog in ST = 0, if yes, than set the order backlog in EUR also to 0.
    Any best practices?
    Many thanks and best regards,
    Michael

    Hi Suman,
    thanks aigain for your reply!
    I have tried your proposal before you have posted it.
    In my special case the following if/else statement works successfully:
    CKF = calculated key figure
    Formula1 = (CKF1 == 0) * 0 + (CKF1 <> 0) * CKF2
    In my case the CKF2 is the result value from "Incoming Order value" - "Turnover"
    So I had to define a separate Formula (1:1 equals to CKF2) and then I was able to set "*CKF2" in the statement.
    The statement CKF2 = (CKF1 == 0) * 0 + CKF2 is not possible (because it´s not possible to calculate from CKF2 itself).
    Now it works
    Best regards,
    Michael

  • Values Bifurcation in BEx Query Designer

    Dear BI Gurus,
    In a column we are getting both positive value and -ve value. We want to bifurcate the values and show only +ve value in one column and show -ve value in another column. Is it possible through Bex query designer?
    Please through some light on this issue.
    With Regards,
    Balachander.S

    Hi bala,
    This can be achieved by creating two calculated Key figures, Just use else if condition in the formula and use if KF1=KF>0 then KF else 0, here all the positive values will be displayed similarly use if KF2=KF<0 then KF Else 0 it will display all the negative values. But here all the values will be displayed. Just hide the Key figure and display only calculated keyfigures. Else you can use exceptions to differentiate the positive and negative values.
    Hope this helps.....
    Rgs,
    I.R.K

Maybe you are looking for

  • How do you get apps for the 1st generation iPod touch

    How do I get apps for the 1st generation iPod touch?

  • Quicktime 10.1 Won't Play

    I'm having an issue with Quicktime Version 10.1 whenever i load a video of anykind MOV. AVI. WMV. whatever it load up just fine, but when i press play it plays then it stops, so i press play again and it stops again the cycle continues i can't seem t

  • Extended Notifications - Recipient Address

    Hi, I am creating a subscription in SWNCONFIG (Extended Nofications) that should go to a particular e-mail address. When I set an e-mail adress with INT Internet Mail nothing is sent via report swn_selsen. The subscription works fine when setting a u

  • PO output problem

    Hi, Presently PO Output is printing with Item Text. This is Standard document type NB. I configured another document type copied from NB as ENB. While i am creating Purchase order with ENB item text is not comes to Out put. Any configuration Missed.

  • Java code to connect to remote windows machine from local machine

    Hi, I have developed a code to connecting remote windows M/C from local M/C by using SSH2 (ganymed-ssh2-build209.jar) API. when I run the code its giving below error. Can any one please help me how to resolve it. And also please let me know, is there