cancel
Showing results for 
Search instead for 
Did you mean: 

IF ELSE Statement in BEx Query based on the results

Former Member
0 Kudos

Hi experts,

I want to realize the following IF/ELSE statement in a BEx Query in respect to the result values

If the result of KF1 equals 0, than set the KF2 to 0, Else (KF1 NE 0) show the value of KF2

Background: I want to report the order backlog. In the example above we have an incoming order value of 23.700,80 EUR in periode 12.2013 and an turnover of 22.370,80 EUR in periode 01.2014. The order backlog in ST (KF1) is 1 ST (12.2013) - 1 ST (01.2014) = 0 ST. The order backlog in EUR (KF2) is 23.700,80 EUR (12.2013) - 22.370,80 EUR (01.2014) = 1.330 EUR. The Order and Invoice is finished, but we have an positive order backlog in EUR (reason: less turnover as incoming order).


For this case I want to realize the IF/Else statement to check if the oder backlog in ST = 0, if yes, than set the order backlog in EUR also to 0.

Any best practices?

Many thanks and best regards,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

former_member182470
Active Contributor
0 Kudos

Use this in  KF2 definition : ( KF1 == 0 )* 0 + KF2

Former Member
0 Kudos

works it also for results?

former_member182470
Active Contributor
0 Kudos

I believe it should work if KF1 result is zero.

Former Member
0 Kudos

Hi Suman,

thanks aigain for your reply!

I have tried your proposal before you have posted it.

In my special case the following if/else statement works successfully:

CKF = calculated key figure

Formula1 = (CKF1 == 0) * 0 + (CKF1 <> 0) * CKF2

In my case the CKF2 is the result value from "Incoming Order value" - "Turnover"

So I had to define a separate Formula (1:1 equals to CKF2) and then I was able to set "*CKF2" in the statement.

The statement CKF2 = (CKF1 == 0) * 0 + CKF2 is not possible (because it´s not possible to calculate from CKF2 itself).

Now it works

Best regards,
Michael

Answers (0)