BEX Formula with IF

Hello BI experts,
I try to calculate a formula using boolean operators (IF, AND).
When I execute the query, I had a message like this but I only use amount in EUR 
So I've added NODIM in my formula but the result is displayed without EUR
If I don't use NODIM, the result is displayed with strange unit : EUR^2
Do you have any idea to display the result with EUR symbol?
Thank you in advance
Regards,
Nicolas 

Hi Nicolas,
The Display of your Unit seems to be like EUR raised to powere 2 of EUR Square.
I have not seen this type of Unit display. However, I think When you apply the NODIM, try to apply it only for the Net sales +Portfolio YTD Key figure and check if results displayed correctly.
Hope this helps.
-Swati.

Similar Messages

  • Bex Formula with Condition - Creation

    Hello All,
    We need to create a formula, and the condistions are provided below.
    if (A > B) and
    if (C > (A - B)) then X = (A - B) * D
    else
    X = C * D
    else
    X = 0
    In Excel the formula is defined as,
    X = IF(A>B,IF(C>(A-B),(A-B)D,CD),0)
    Can someone provide the Bex solution for this?
    Kind regards,
    Edited by: Jith136 on Oct 6, 2011 1:44 PM

    HI ,
    You cannot use if condition in bex query designer.. instead try the same with Boolean operator in three new formulas ...
    formula1  (A > B .and. C > (A - B) ) (A - B) * D
    Formula2 (A<=B .and. c<(a-b))  C * D
    formula3  formula1+formula2...
    when you are creating formula on right pane you can see boolean operator use them to meet your requirement .. I don't have access to my server rit now so i am not able to check the same , if you feel to change operator accordingly. 
    Thanks
    BVR
    Edited by: binu v. rajan on Oct 6, 2011 6:00 PM

  • Can i now exact bex formula to be inserted

    Can i know the bex formula to be used by if  else statement in bex query.
    if f9 greater than e9  then result should be  E9*B9   else  F9*B9
           IF(F9>E9,E9*B9,F9*B9)

    Hi Naiduz,
    There I have missed one point, you have to create a formula variable for both these fields and with replacement processing type. Then only you can use the formula like this.
    Hope this clarifies totally.
    Kindly refer the doc for more understanding. It has been explained crystal clear here.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d08b56a8-daf5-2e10-2397-904d6aeb55c2?QuickLink=index&…
    Thank you.
    Chandan Praharaj

  • BEx Formula Use of 'Logical And' and Calculation for Gross Margin

    HI Bex gurus.
    Having an odd time with what should be a simple formula to handle the display of gross margin (GM). The goal here is to display GM% properly and the requirement is as follows
    If GM <= 0 then 0.0
      Else
    If GM > 0 and Sell > 0 then ( ( sell - cost /sell ) * 100 )
      Else
    If GM >0 and Sell = 0 then 100
    I am familiar with bex formulas and have referenced the help docs on booleans here -
    Boolean Operators - SAP Business Explorer - SAP Library
    But what is odd is that if I use a calculation or a CFK in the IF, THEN with a LOGICAL AND, the formula does not report correctly
    If I put in a static value, like 77, the expected logic is followed.  I have tried making sure have extra parentheses and changing the order of the statement, to no avail!  I could use some extra brains on this puzzling matter, so you help is greatly appreciated and will award points!
    Thanks
    lee lewis
    Here are the formulas in text and below screen shots.  Wish could copy and past formulas to and from editor!
    GM%77
    ( ( ( 'Order GM' >0 ) AND ( Order Sell  >  0 ) ) == 1) * 77 + ( ( ( 'Order GM'> 0 ) AND ( Order Sell == 0 ) ) == 1) * 100 + ('Order GM' <= 0) *0.0
    GM%
    ( ( ( 'Order GM' >0 ) AND ( Order Sell  >  0 ) ) == 1) * 'REF GM%' + ( ( ( 'Order GM' > 0 ) AND ( Order Sell == 0 ) ) == 1) * 100 + ('Order GM' <= 0) *0.0
    'REF GM%
    (order  sell - order cost /order sell ) * 100 )
    GM%77
    GM%

    Shouldn't you change on of the brackets in your REF GM% ?
    'REF GM%
    (order  sell - order cost /order sell ) * 100 )
    I would put that as
    'REF GM%
    (order  sell - order cost) /order sell  * 100 )
    Not sure what you mean with those red arrows... but in both cases you would be dividing by 0 (order sell = 0).

  • Report on BEx query with 2 structures (one in rows and one in columns)

    Hi, experts! I have to make Crystall report on BEx query with 2 structures, one in columns (with KF's), and one in rows. Is it possible to create such report? Because when I create such report, I cant see fields in structures, only characteristics fields.
    Ok, I found samr problem in another thread. Sorry.
    Edited by: Mikhail Sychev on Dec 5, 2009 9:53 PM

    Hey Flora,
    Happy to hear that its working now.
    Answering your question, again its upto the connection and report format you are using. Based on your question i hope you your report output should be like this.
    You cannot map to two labels for the series, again this report format is possible only in cross tab through Webi. I would suggest you to concatenate the material and month in a dimension in webi like below.
    I have done the concatenation in excel level, i would suggest you to do that in webi. Try to reduce the formula as much in excel.
    or
    If you are using Query browser connection, then i would suggest you to create a separate report which will display the actual vs plan material wise, here you need to pass the material as a prompt.
    Hope this helps in clear, please revert me for any clarification.

  • How to use rounded values in BEx Formulas

    Hello,
    I have the following question. Is it possible to use rounded values up to a certain # of decimal points in BEx Formulas?
    I have the following problem.
    Consider this:
    keyfigure val 1 = 0.416666667
    keyfigure val 2 = 72
    val 3 (BEx Formula)  = val 2 / val 1 = 172.799999862
    However, what I need to do is this.
    val 1 & val 3 should rounded up to 2 decimal points. So, I really need the report to show this:
    val1 = 0.42
    val2 - 72
    val 3 = val 2 /val 1 = 171.43
    I changed the number of decimal places on val 1 and val3 to be 0.00. However, it appears that these rounded values are not taken into account in  the Formulas, as if the OLAP still uses the original values from the backend with 9 decimal points. So, no matter how many decimal points I use on the Display tab for a key figure, my val3 or result of my formula is always taking into account the 9 digit decimal values, not rounded values that I want. So in the example above, my val 3 comes to 172.80, which it should be 171.43 instead of you use the rounded values in the calculation.
    Please let me know if there is any workaround where I could force my BEx Formula to utilize the rounded values and not actual values from the backend DSO. Or any other solution.
    Thank you

    If you create a Formula in BEx Query Designer like the one below, it works:
    val3 = val2 / ( TRUNC ( ( val1 * 100 + 0.5 ) ) / 100 )
    The TRUNC function (among other things) actually ensures that your formula takes into account the rounded values that you want.

  • MAX( , ) function in BEx formula

    Hello Experts!
    Does anyone know, how the mathematical function MAX( , ) in BEx-formulas work? Which are the two parameters if i want to have the maximum of the values in one colum? Or does this function work another way?
    Best Regards,
    Peter

    Hello Oscar!
    Thank you for answer! Thats what I want to know but it doesn't solve my problem. If I use calculate result as maximum and if I want to calculate with this value (maximum) than i got a result which is calculated with the sum, not with the maximum which I see as result.
    I do open a new thread for new question...
    Thanks,
    Peter

  • Setting in BEx formula for calculation of YTD and MAT

    Hi,
    I have to implement 2 formulae in BEx.
    As I am trying to avoide ABAP coding, can anyone please suggest SETTINGS in BEx FORMULA to achieve these below mentioned 2 formulae -
    1 ) Calculate YTD - Average of the sum of the reported quarter values from the start of the year until and including the selected quarter. But, if we enter Quarter 3 and there is no data for quarter 2 then the average should be equal to sum of data for Q1 and Q2 divided by 2 instead of 3 even though user entered Q3.
    2) Calculate MAT - Average of the sum of the reported quarter values for the last 4 quarters. We need to check last 4 quarters. If data is present only for 3 quarters in the last four quarters then the MAT will be data for 3 quarters divided by 3.
    Please suggest BEx formulae settings, if any for the above calculations.
    Thanks a lot.
    Regards,
    Prerna

    Hi
    I am not sure requirement related YTD is possible without customer exits variable
    But regarding your 2nd requirement
    Calculate MAT
    Create four restricted key figures by using offset (0, -1, -2, -3) and restriction characteristic will be quarter.
    Create a calculated key figure "Count of Quaerter". This will consist of "Number of rows" key figure with exception aggr on the Quarter characteristic and aggr will be "Count for all not eq to 0".
    Create a calculated key figure which will be sum of four restricted key figures divided by Count of Quarter.
    Kindly let me know incase further details required
    Best Regards
    Rohit

  • BEx formula change not working in existing Analysis for Olap/Analysis for Excel reports

    Hello all,
    I posted this in Analysis for OLAP, but there has been no response so I'm hoping perhaps you BEx experts can help me.
    I had to modify a formula in a Bex query to have it calculate the results of the formula by summation.
    I checked the query using BEx Analyzer and it summed correctly.  If I create a new analysis for olap report, it sums correctly.
    If I modify an existing report, it does not pick up the change.  Existing Analysis for Excel reports also do not pick up the new summary calculation.
    Using the CMC, I edited the connection and reselected the Bex query, but that did not work either.
    Here it is working in the query:
    Line Discount is a formula with logic checking to see if "product list price total amount" is 0, set the line discount to 0; otherwise calculate it as "product list price total amount" - Net Sale.  So the total needs to sum of the line discounts (0+2820+2820 = 5640) and not be the Overall result "product list price total amount" - Overall Result "net sale" (13960-96720= -82760).
    Here it is in an existing Webi report - working:
    Here is what is happening in an existing Analysis for OLAP report - not working:
    I also tried to unselect Line Discount as a key figure from the existing report and reselect it, but that did not work.
    I'd like to find a solution so that all the reports that use this query won't have to be rewritten.
    I'm on BW 7.0 EP 1 SP 10 and BI 4.0 SP7 Patch 5.
    Thank you for your help,
    Susan

    Hi,
    Apply Exception aggregation on line discount formula--Exception aggregation as Total---Reference characteristic as Promega product.
    Make sure to refresh the webi report once after the changes has been done.
    If this does not work then you can apply summation calculation for that column at webi level as well.
    Regards,
    AL

  • BEx - formula aggregation

    Hello all,
    I have a BEx problem which does not seem to be unique, but as yet I have not found a solution.
    I have a query u2013 developed in frontend version 3.5 u2013 which is not showing required results at an aggregated level.
    Consider the following columns: Material1, Material2, Total
    and the following rows: Value1, Value2, Value3
    where Value3 is the following formula: If Value1=0 then Value2, else Value1
    Value1 200 0 200
    Value2 100 150 250
    Value3 200 150 350
    However, I do not want to have Material in the default view, therefore I see the following values:
    Value1 200
    Value2 250
    Value3 200
    In this case I want Value3 to equal 350 not 200.
    The query calculates the formula based on the aggregated data, but I want it to use the detailed data. The example above is the problem in itu2019s simplest form, my query is actually a little more complex than this. I am not able to use u2018Before Aggregationu2019 on a Calculated Key Figure, because my formula is u2018too complexu2019. I have also tried various combinations of u2018Calculate Results asu2026u2019
    The query is based on a multiprovider and remodelling the backend would be complex, if it is even possible. I would like a frontend solution.
    Any suggestions/help would be greatly appreciated.
    Thanks,
    Simon.
    Edited by: Simon Evans on Jul 21, 2008 3:11 PM

    Hi,
    Thanks for viewing the thread. And happy to let you know that the issue was resolved.
    The solution was:
    Two formulas (local) were created, one including the formula variable with replacement path for ZD1, with exception aggregation on ZD1, and the other with formula variable with replacement path for ZD2, with exception aggregation on ZD2. Both these formulas are hidden.
    Another formula (local) was created for u2018time takenu2019 = formula with ZD1 u2013 formula with ZD2, with exception aggregation total on u2018ZDOCNOu2019.
    For the second instance, when one requires exception aggregation on records that has multiple values for keys, a nesting of formulas can be done displaying only the ones required.
    For e.g. a formula with exception aggregation on say characteristic u2018item no.u2019 can be hidden, and included in another formula for exception aggregation on characteristic u2018document no.u2019. This is a typical case where one can achieve calculation before aggregation for a calculated key figure, formula or a counter.
    Hope it might help someone, and saves time and effort for a similar issue posted.
    Also would like to keep this thread open for exploring better solutions.   
    Regards,
    Vijay

  • How to define Excel function using BEx formula

    Hi experts,
    May I know how to define the following Excel function using BEx formula?
    IF(AND(Revenue<0,Cost<0),"N/A",(Profit/Lost/ABS(Revenue)))
    Thanks!

    for me its easy to implament logic with * and + rather than  AND and OR respectively
    ((Revenue<0)(Cost<0))Value +((Revenue>0)(Cost>0)) ( Profit&Lost / ABS(Revenue))
    As i have mentoned already,for Else case i have considered (Revenue>0) and (Cost>0)  only.
    Value can be a KeyFigure/Formula/formula variable/CKF/RKF
    its not possible to type characters in the formula window so 'N/A'
    Regards.
    Message was edited by:
            Murali c

  • Using Infoobject value in bex formula

    Hi experts,
    i have bex query containing calculated KF's
    i need these CKF's will get changed, if the value of the infoobject 0ITEM_CATEG is 'ZOTX'
    i have tried to use formula variable with replacement path on 0ITEM_CATEG, but when i am creating new formula with the formula variable  i can not write ' 0ITEM_CATEG = ZOTX'
    appreciate advce here
    Thanks
    Nir

    Hello,
    For your requirement virtual KF concept is appropriate.
    Regards,
    Shashank

  • Bex Formula help required

    Hi,
    I have a requirement for a formula in bex,I have 2 key figures ie A (Actuals) & B (Targets).I need a new formula with the condition - if A>B then result should be 1 and if A< B then result should be 0 . I need the condition in the same formula.Kindly provide me a formula for these using boolean operators

    Hi,
    Your formula can be.
    (A>B)Result + (A<B)Result =0
    Regards,
    ray

  • BEx Formula Problem (If-Else)

    Hello everybody,
    I am heaving a little problem with the BEx Formula Editor.
    I would like to create a formula based on time dependent attributes; witch should provide me with an actual customer rebate.
    The Query should look like (displayed in Excel/Analyzer):
    Customer Rebate A Rebate B Rebate C Actual Rebate
    1         5 %     10 %      0 (#)       10 %
    2         2 %      0 (#)    0 (#)       2 %
    3         5 %      0 (#)    0 %         0 %
    Rebate A, B, C are attributes of different characteristics and for being able to use them in my formula (for Actual Rebate) I have created a formula variable (replacement path) for every rebate. I have already figured out, that there is no possibility to differentiate between real zero values and zeros being displayed because there is no value defined (#) (at least it seems so to me). So I added another attribute which is 1 if there is a value. For the following example let’s call it “Rebate X (exists)”
    The formula I would like to use should contain the following logic:
    If (Rebate C (exists) == 1) {
    Actual Rebate = Rebate C
    } elseif (Rebate B (exists) == 1) {
         Actual Rebate = Rebate B
    } elseif (Rebate A (exists) == 1) {
         Actual Rebate = Rebate A
    } else {
         Actual Rebate = 0
    Any help would be appreciated.
    Kind Regards
    Simon Ulrich

    Hi,
    I suppose Eugenes Formular will give you the total of all three rebates if they all exist. To get the elseif correctly, I propose a formular like
    (Rebate C (exists) == 1)* Rebate C + NOT (Rebate C (exists) == 1)* (((Rebate B (exists) == 1)*Rebate B) + NOT (Rebate B (exists) == 1) * ((Rebate A (exists) == 1)*Rebate A))
    Hope all brackets are set correctly, slightly confusing in this editor

  • Bex formula shows empty cell (NULL)

    Hi,
    I have a bex formula that calculate a few fields.
    sometime there is no value in it (NULL)  and effects bedly on other formulas in the query. (NULL also)
    i have tried several ways  to solve it:
    multiply with 1
    IF condition
    add and reduce 1
    but still the column shows NULL (empty cell)
    thanks a lot for helping me out
    points will be granted
    nir

    Hi Nir:
      Nulls used in formulas give Nulls as results. So you need to deal with the Nulls since the first occurrence, replace the Nulls and use another value instead.
    To evaluate if a null is present use the function "IS_INITIAL" in your formulas, this is a boolean function and therefore has the return values TRUE and FALSE.
    Unfortunately the function "IS_INITIAL" is not available for BEx queries, you can use it on transformations while loading DataTargets.
    Regards,
    Francisco Milán.
    Edited by: Francisco Milan on May 31, 2010 1:55 PM

Maybe you are looking for