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

Similar Messages

  • How I tie the formula with conditions type?

    Hi,
    Than create the formula with tcode O3I7:
    1) how I tie the formula with conditions type?
    2) how I tie the conditions type with the formula with Calculation Schema?
    help me, please.
    thanks
    Edited by: celeste ziantoni on Feb 5, 2008 6:45 PM

    Hello,
    Pricing formula is created using transaction VOFM. It is tied to the condition types in Pricing Procedure definition in Alternate Calculation Type column. For Pricing procedure, the menu path is SPRO->Materials Management->Purchasing->Conditions->Define Price Determination Process->Define Calculation Schema.
    Thanks,
    Venu

  • FR Studio - Sum formula with conditional replacement not working

    Hi All,
    I'm on Hyperion FR Studio 11.1.2 and trying to build a report against our HFM information.
    I'm building a drillable income statement report that conditionally replaces any future months' information with a "-". However, when I try to use the [A:L].sum function to sum up all the months to get to a YTD value, the result comes up with nothing. The reason I'm using the conditional replace is because I don't want the periodic amount pulling through for the next month as a negative number and subsequently make the YTD sum zero.
    I also tried to change the conditional replace to "0" hoping it would recognize a number better than a dash, but the summation formula still didn't work. I'm also hesitant to use the "YTD" view to pull the YTD column because I have the report scaled to thousands. The report does not always foot when adding the rounded periodic values vs. pulling a rounded YTD value.
    Does anyone have a suggestion on how to build this report better or how to get the summation formula to work?
    Thank you!
    MR

    Might be best to open an SAP message.  But till then try the following.  It may work-
    include two formulae in your query
    Formula1 = First Day of Next week
    Formula2 = Original Promise Date
    Calculate Past due Days = Formula1 -Formula2
    You can hide both Formula1 and Formula 2 in query view. (or you can leave them open temporarily to see if they are actually getting populated). Also ensure that the dates on which the replacement path is being done are present in the query view.
    I dont know why but this worked for us.

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

  • Universe on Bex Query with Condition

    Hi,
    I'm working on creating a WebI version of a Bex Report. I've created a universe on top of the Bex Query and then a WebI report based on the Universe. The Bex Query contains 4 conditions. They allow optional filtering of two measures, Less Then or Equal and Greater Then or Equal. The conditions are applied at the employee level of the results set, so for example, if an employee's total sales is greater than 50 and the user enters 50 for the condition then none of that employee's rows of data will appear.
    A single filter was created in teh Universe containing all four conditions. I had to update the syntax as they were all brought in using Equals instead of the GreaterorEqual and LessOrEqual. I also updated the filter key to use the @Select and the correct dimension.
    In the WebI report, only the two using LessOrEqual are functional. The two conditions that utilize GreaterOrEqual will only remove individual rows, not the enter set of rows for that employee. I've set the aggregation to sum instead of Database Delegated for the two affected measures.
    If anyone has any input on how to get the GreaterOrEqual conditions functioning properly, or a workaround that will remove all rows for an employee when their sales are not above a cert number, it would be greatly appreciated.
    Thanks,
    Jeff

    Also here is the syntax for one of the filters that is not functioning properly.
    <OPTIONAL><FILTER KEY="@Select(Total Quantity of Adjustments\Total Quantity of Adjustments)"><CONDITION OPERATORCONDITION="GreaterOrEqual"><CONSTANT CAPTION="@Prompt('Minimum Quantity of Adjustments','N',,mono,free)"/></CONDITION></FILTER></OPTIONAL>

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

  • Results for % calculation with Condition

    I have a condition on my query in BEx Query Designer that limits the customers shown to ones who have a dollar value in a particular column.  I am now trying to get the results rows to take the condition into account.
    For the dollar key figures, I can just set the results calculations to "Total", and that gives me the total dollars for the customers displayed (that fit the condition), as opposed to the total dollars for ALL customers (if I didn't have the condition).  This is correct.
    However, I have another key figure that represents what percentage of one dollar key figure that another dollar key figure is.  I cannot get the result rows for this key figure to correctly show me the results of the calculation for only the values that match the condition, it keeps showing the percentages based on the full dollar quantities outside of the condition.
    Is there a way for me to get the calculation that I want?
    Query without Condition:
    Customer_____Dollars1_____Dollars2_____%
    A_____________5___________20________25
    B____________10___________20________50
    C____________10___________10_______100
    Result________25___________50________50
    Query with Condition (Dollars1 > 5) Current behavior (wrong):
    Customer_____Dollars1_____Dollars2_____%
    B____________10___________20________50
    C____________10___________10_______100
    Result________20___________30________50
    Query with Condition (Dollars1 > 5) Desired behavior (correct):
    Customer_____Dollars1_____Dollars2_____%
    B____________10___________20________50
    C____________10___________10_______100
    Result________20___________30________66
    Please Help!

    Hi,
    As i cannot see invoice document number in output so would suggest to go for nested exception aggregation.
    Create a new formula and put your aggregated keyfigure inside it and repeat the steps which i told in my last post.
    Make sure to apply it on both the keyfigures.
    If this also not works then last approach would be---
    Make a formula variable with replacement path for customer in replacement path tab choose replace variable with infoobject-replace with attribute value-attribute constant 1..in currency/unit ttab choose number..
    Now multiply your both keyfigure with this formula variable.
    Hope it helps.

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

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

  • Conditional creation of accounts in a resource - required field not working

    Hi,
    We want to conditionally create account objects in a resource, based upon whether or not the users account has a non-empty value for a particular atttribute.
    To me this seems to be what the 'required' attribute on a field is for, in theory I should be able to tag a field as required, and then if an account dosn't have a value for the attribute, it won't be created on the resource.
    The Help, from IDM6.0, says the following:
    Required -- If this attribute is required to create an account on the resource,
    select the option. This selection applies only when creating accounts.
    When I try to do this though, it fails, it goes ahead and creates the account within the resource anyway.
    So what did I do wrong, or am I misunderstanding the meaning of this.
    To test this, I created 2 XML Resources, Res1, and Res2.
    I specified that Res1 had accountId, and email as attributes.
    I specified that Res2 had accountId, and email as attributes, but ticked email as required.
    I made accountId the idntity template in both cases.
    I then created 2 test accounts test1, and test2, but only gave an email address to test1, but assigned both resources to both accounts.
    Both resource xml files had both users listed.
    For those who care more, the reason we want to do this is that we are running an LDAP with a sendmail tree, and want to populate this via IDM, all our users have email accounts, but not all have email aliases. Therefore, we only need some of the users to have entries that look like this.
    sendmailMTAKey=fred.bloggs, ou=sendmail, o=anu.edu.au
    sendmailMTAHost=anu.edu.au
    sendmailMTAAliasValue=u1234567
    sendmailMTAKey=fred.bloggs
    sendmailMTAAliasGrouping=aliases
    objectClass=sendmailMTA
    objectClass=sendmailMTAAlias
    objectClass=sendmailMTAAliasObject
    objectClass=top
    So I guess the question is really 2 things, what am I doing wrong with conditional account creation? Is this the right way to create these entries in the LDAP sendmail tree?

    Hi again,
    For those who care, I've got a resolution to the specific problem I mentioned in the above post, even if no answer to the general question of conditionally adding accounts on resources.
    In this specific case, I had been given a poor description of the requirements of the sendmail schema. It turned out on closer investigation that a single ldap record could hold all the information needed. It seems the sendmai schema had been implemented inefficiently locally, before we looked to run it through IDM.

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

  • TAXINJ WITH CONDITION BASED CALCULATION

    Hi MM Gurus
    We are using TAXINJ procedure for tax calculation with formula base calculation (i.e. tax rates are maintains in J1ID ). As we now that TAXINJ procedure support both condition based and formula based tax calculation. But when I want to use the condition based tax calculation with TAXINJ by maintaining the condition record in FV11, I am getting the tax calculated with formula based only. System is ignoring the condition record maintain in FV11. So please explain how to use the TAXINJ procedure with condition based calculation by maintaining the condition record.
    Reward point will be given please…..
    J K Patel
    Ahmedabad
    Gujarat

    Hi JK,
    if you r using taxinj, then system picks up the rate from J1ID only. if you want to maintain the condition records in FV11 then delete the rates in J1ID. hope this will solve your problem.
    Regards,
    patil

Maybe you are looking for