if then else statement in Bex reporting

If ever in SAP Bex reporting you are faced with the challenge of populating a column or a cell based on values in two other columns or cell values use the following in a formula.

Example –  Column1 = 50,  Coulmn2 = 110, Column3 = [If value in column2 > 100 then use column2 else use column1]

The above requirement can be written in a bex formula as

(( column2 > 100) * column2) + ((Column2  < 100) * Column1)

one easy way to remember it as a “if then else” statement is to substitute the first condition as  a default “if”.  In the above example

column2 > 100 (If column2 > 100)

replace the * with THEN

replace + with ELSE