Debug Bex Formula

Dear Experts,
I have written a formula in Bex using boolean operators.  Now how can i possibly debug this formula?
Please help.
Tony

I have a kf called 'net amt after adjust'. I have another formula which counts the 'no. of orders'. Now i want to specify an if condition in a formula that says if 'net amt after adjust' is zero then vaue is zero else if 'net amt after adjust' not zero then result is equal to 'no. of orders'.
What i did was
('net amt after adjust' == 0) * 0 + ('net amt after adjust' <> 0) * 'no. of orders'
But the 'net amt after adjust' does not seem to equate to zero but the result is always 'no. of orders'. I tried to take the decimal places into consideration but it didnt help.
Please help.
Tony

Similar Messages

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

  • 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

  • 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

  • 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

  • BEx formula: Key figure divided by overall result

    Good afternoon
    I need assistance on how to do the following BEx formula please?
    I have "Sales" totals per "Dealers"
    example:
    Dealer: Sales
    A         10
    B          5
    C          6
    Overall Result  =  21
    How do I create the formula in BEx if I want to divide Sales for dealer A (10) with the 'Overall Result' Sales (21)? Note,
    Your assistance will be appreciated.
    Cj Faurie

    Create a <b>Formula</b> below the <b>Sales Key Fig</b> and use the follwoing <b>formula</b>
    <b>Sales / SUMGT ' Sales'</b>
    <b>SUMGT</b> will be available in the <b>Data Functions</b>

  • Using Text Variable in BEx Formula

    Hi Everyone,
    I have two columns in BEx query. First column shows the value based on variable ZFISCPER_M(based on fiscal year/period).
    The other column shows the value for period ZFISCPER_M minus 1 (I have used offset in variable).
    So if my user inputs 009.2009, the first column will show values for 009.2009 and 2nd column will show values for 008.2009.
    In the third column I have formula : 2nd column minus 1st column. I want to use text variable to display column heading. The heading in the 3rd column should be 009.2009.
    Can anyone guide me how to achieve this?
    Regards
    Utpal

    Hi Rakesh,
    My first column shows cumulative balance upto 009.2009; My second column shows the cumulative balance upto 008.2009; In the third column I am trying to display balance for the month - not the cumulative figure. So for the third column my heading should be For the month 009.2009
    But when I substract col 2 - col 1in third column; the text variable finds two different values(009.2009 & 008.2009). Hence it is not displaying any text.
    I hope this makes my question clear.
    Regards
    Utpal

  • BEX formula.. How to know the row value in formulas dynamically

    Hi all,
    I just need to clarify a doubt..
    Requirement:
    COL1      -               COL2
    Y1            -               X
    Y2            -               X + 12
    Y3            -               X + 12 + 12
    YN           -               X + 12 + 12 + u2026 12(n)
    Y is dynamic from the source datau2026.. Itu2019s the year (2009,2008u2026 etc..)
    X value is from the user (i/p variable value). Some dummy valueu2026
    Now, the main logic I want to incorporate is like using a formula for COL2
    COL2 Formula looks like thisu2026.          X + (12 * N)             where N= 0 for the 1st row; 1 for the 2nd row; 2 for the 3rd row like thatu2026..
    How to dynamically allocate value for N based on the row count?
    Pls. let me know if you find somethingu2026.
    Thanks.
    Edited by: Arun Bala G on May 21, 2010 10:59 AM

    how abt this:
    This approach only valid for Workbboks..
    create COLUMN3 just type like this
    0
    12
    24
    and drag this upto end of Col1 and Col2 so it will poulate multiples of 12 then in Column 4 apply the C1-C2+C3..
    hope it helps
    Sorry Bhaskar,
    Hardcoding the formula is not relevant at all. May be you had not read this query properly. Its no way related to being dynamic right... If it was Excel workbook, anyone would have used a simple formula & moved values like cakewalk.
    So unfortunate! BEx has some limitations..
    All I need in my query is some counter like 1,2,3.... till the end of the last record. That's all.
    Pl. find the sample data
    COL1     COL2          
    2009     1.3          
    2008     13.3          Which is 1.3+12
    2007     25.3          Which is 1.3+12+12
    2006     37.3          Which is 1.3+12+12+12
    Do let me know if you have any clues?
    Thanks!
    Edited by: Arun Bala G on May 21, 2010 11:20 AM

  • 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

  • BEX formula

    Hi all,
       I have a problem while defining a formula in BEX Query.
    My formula looks like this.
    (1- ( abs(X - Y) / X )) < 0) * 0 + not(1-( abs( X - Y) / X ))<0)*10
    Requirement is that if X = 0 then output = 0 else 10.
    In th above formula used, if X = 0, it gives error ' divide by zero'.
    I tried to use NONDIV0( )  for the division part, if X = 0, output = 10, which is an error again.
    This is jst a sample of a complex formula I am using. I dnt want to change the whole structure of the formula.
    Any suggetions will be rewarded.
    Regards,
    Adarsh

    Hi,
    (1- ( abs(X - Y) / X )) < 0) * 0 + not(1-( abs( X - Y) / X ))<0)*10
    Requirement is that if X = 0 then output = 0 else 10.
    Your requirement just mentions X, why do you have Y in your formula? For the above requirement, you can simple write
    (X <> 0) * 10

  • Debugging BEX Queries

    I am still on BW 3.0.
    1. . Is there a way to do debugging similar to ABAP debugger when one can run BEX Query step by step and print variables, characteristic, key figures etc
    2. Somewhere I saw a trace option in query designer or so. What is its purpose?
    I am aware of RSRT transaction.
    Thanks.

    Hi,
    Please find some links for RSRT.
    1) Query Monitor vs. Query Run-Time statistics (BI Admin Cockpit)
    Performance tuning with screenshots:
    2) http://www.google.co.in/url?sa=t&source=web&cd=5&ved=0CCMQFjAE&url=http%3A%2F%2Fwww.comeritinc.com%2FUserFiles%2Ffile%2Ftips%2520tricks%2520to%2520speed%2520%2520NW%2520BI%2520%25202009.ppt&rct=j&q=How%20to%20work%20with%20SAP%20BI%20Query%20monitor%20RSRT&ei=3OyRTLaYIYyivgPYv8j9Aw&usg=AFQjCNFdbwiQGezoktMsrxb6x-zf7pflMw&cad=rja
    Regards

Maybe you are looking for

  • Regarding error in third party sales order

    Hi we are doing third party sales scenarion in which when we are creating the sales order for the customer the following error is occuring  " material Gold Chain kept in stock ( if necessary , create a reservation ) Material name:- Gold Chain Materia

  • Quality plan deleted  can it be retrieved? URGENT please

    dear qm friends, by mistake instead of deleting a material assigned to a quality plan the user deleted the quality plan  group can it be retrieved? when trying to create or copy similar quality plan again it is giving another group counter number   i

  • Please tell me How to send   excel file content  to   MAILBOX

    Hello , Can anybody tell me how to send  Excel  file  data to  Mailbox

  • Fields and Table for Delivery address in a PO

    Hi Gurus, I want to find out the fields and the corresponding table for the delivery address in a PO (line item details). It is the address of the plant. I searched the tables ADRNR, ADRN2 and one customized field (/GLB/Ship_to) in the table EKPO, bu

  • X-rite color Checker Folder Path

    I am a photo assistant based in Montreal I'm having issue with X-rite profile location in computer folder... We did create a custom profile with color checker passport during a shoot, re-starded Lightroom then used the custom profile. From there, eve