07 Mar Bex If – Then example
Need to do if – then logic in a Bex query.
The syntax is a little strange but it works.
You can make conditional calculations using Boolean operators An expression in the form
IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
<Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>
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
Brad Simon is a data architect and developer with over 18 years experience implementing business intelligence and development solutions across all versions of SAP including BW on HANA and HANA Enterprise. Brad can be reached at brad.simon@phxend.com
Denise Stafford
Posted at 08:36h, 12 AprilWell written post.