Dec 18, 2009

Using If-Then-Else in Bex

Conditional Calculations (IF-THEN-ELSE)

You can make conditional calculations using Boolean operators An expression in the form
IF THEN ELSE can also be made using a formula in the form
* + NOT *

Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs

can be written as the following formula:

(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs)) * Actual Costs

or

(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs

No comments: