Skip to Content
author's profile photo Former Member
Former Member

BEX Formula assistance required !

HI Viewers,

Could you please help me on this formual. how to to put in BEX syntax.

IF ( X # 0) THEN ( X- ABS ( Y)) / X ELSE ABS ( Y).

Appreciate your support on this !

Thanks

Surendra

Edited by: Surendra Kumar on Dec 7, 2011 1:57 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2011 at 01:18 PM

    Hi,

    You need to use Boolean Operators in your formula.Just create a formula , right click on it and go to Boolean Folder.You will find necessary operators there(like not equal,equal,not etc).Boolean syntax is like this: (Condition)(Result1)+Not(Condition)(Result2).This says if condition satisfied then do result1.Else do result 2.There is no else in BEx.That's why I used NOT(Condition) instead.By the way ABS function is under mathematical functions.Consequently, your formula will be like this:

    (x not equal 0)(x-abs(y))/x + (x=0)abs(y)

    These threads explain your requierement in details:

    Dynamic field selection by variable input in bex report

    Writing formula with boolean operators

    Regards,

    Sunny

    Edited by: sunnybt on Dec 7, 2011 2:43 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2011 at 01:34 PM

    Hi,

    In Bex If condition will be like this.

    If starts with ( ) and Then is * and Else is +.

    As per your requirement IF ( X # 0) THEN ( X- ABS ( Y)) / X ELSE ABS ( Y).

    In Bex you can write like this in formula ( (X # 0) * ( X- ABS ( Y)) / X + ABS ( Y) )

    Thanks

    Riyez

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 07, 2011 at 01:55 PM

    Hi,

    Please try a condition like this:

    (X <> 0 )* (X- Abs (Y))/X + (x == 0) * ABS(Y)

    Note: Make use of boolean operators for equal and not eqaul to.

    • means then and + means else in bex if else conditions.

    Brackets are also imp.which system usually take care on its own.

    Hope it helps.

    Regards,

    AL

    Edited by: AL1112 on Dec 7, 2011 3:14 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 07, 2011 at 02:16 PM

    Hi

    Please use below formula for your requirement:

    (X< >0)*((X-ABS(Y))/X)+ABS(Y)

    Make use of boolean operator for not eqaul to (< >) and replace X and Y with whatever your variables (if any).

    Regards,

    RJ

    Edited by: SHARM RAJ on Dec 7, 2011 3:17 PM

    Edited by: SHARM RAJ on Dec 7, 2011 3:17 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 07, 2011 at 04:11 PM

    Hi

    Use following condition

    (((X # 0)((X-ABS(Y))/X)) AND ((X = 0)(ABS(Y)))

    Regards

    Jagadeesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.