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

IF ELSE condition formula - BEx query designer

Hello guys,

I have 3 columns - C1, C2 and ( C1 %A C2 ).

In C1 % C2, i have to write a formula.

If ( C2 = 0 ) THEN ( C1 * 100 ) ELSEIF (C2 NE 0 ) THEN ( C1 %A C2 ).

The formula I wrote does not seem to be working. I am using this formula in cell reference

(C2 == 0) * C1 * 100 + (C2 <> 0) * C1 %A C2.

This is not working.

When I use this formula in the cell reference, then the result is still 'X' (i.e. undefined)

If I use only this:

(C2 == 0) * C1 * 100

Then the formula works fine (eg. if C1 = 2, C2 = 0 result is 200%).

I tried to use 'OR' instead of '+' in the formula. Nothing seems to work.

Please advise.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 04:33 AM

    Hi Sachin,

    You can try the following.

    ( C1 %A C2 ) * Count (C1) + ( C1 * 100 ) * DELTA(C1)

    This will calculate as follows:

    If Column C1 is having value ie NE 0, then, ( C1 %A C2 ) will be calculated. And if column C1 is equal to 0 then ( C1 * 100 ) will be calculated.

    Just try this and let me know if it works....

    Regards

    Lavanya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 03:42 PM

    Hi Sachin,

    Is your requirement that if in case C2 equals 0, then consider C2 as 1

    In case you are still facing the issue, then can you try creating a new formula as (C2==0)1 + (C2 <> 0)C2. Keep this formula hidden

    And to get C1%AC2 use C1%AFormula

    Thanks

    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.