cancel
Showing results for 
Search instead for 
Did you mean: 

IF Else statement in BEX

Former Member
0 Kudos

Dear BW Eperts,

I am working on one of the Support issue below logic is applied at query level  i am not sure about how it will work can any one explain the logic that would help me a lot.

(NODIM (A) == 0) * (NODIM (B) == 0) * (NODIM (C) ==0) * (NODIM (D) == 0) * (NODIM (E) ==0) * 8 + (NODIM (E) <> 0) * (NODIM (E))

Here all A,B,C,D,E are restricted key figures

Thanks

Theertha

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member194898
Active Contributor
0 Kudos

Hi,

Each time we write "(anyFigure  = 0 )" we check if that figure is equal 0

     if yes (that figure = 0) then we get true (i.e. value 1)

     if not  (that figure = 1) then we get false (i.e. value 0) 

if you use NODIM() function you get value without currency description, ie. instead 600 USD we get 600).

now in your case:

(NODIM (A) == 0) * (NODIM (B) == 0) * (NODIM (C) ==0) * (NODIM (D) == 0) * (NODIM (E) ==0) * 8 + (NODIM (E) <> 0) * (NODIM (E))

the function works like this:

(assuming all figures are 0)

if A=0 AND B=0 AND C=0 AND D=0 AND E=0   *   8     +        E<>0  *  E=0        then    ???

    1      *        1      *      1      *       1      *       1    *    8      +       here always 0       then      8

(assuming all figures but A are 0)

if A=0 AND B=0 AND C=0 AND D=0 AND E=0   *   8     +       E<>0   *   E=0        then    ???

    0      *        1      *      1      *       1      *       1     *   8      +       here always 0       then      0

All in all:

Your function checks if all  the figures you use are eqall 0

if yes so get 8 if not you get 0.

Hope it helps,

Regards, Leszek

former_member976
Active Contributor
0 Kudos

HI,

if A,B,C,D,E is equal to 0 then out put come 0 or 1.

again multiplying with the 8 and E.

(NODIM (A) == 0) * (NODIM (B) == 0) * (NODIM (C) ==0) * (NODIM (D) == 0) * (NODIM (E) ==0) * 8 + (NODIM (E) < 0) * (NODIM (E))

can you explain to us what you want achievement.

Thanks,

Phani.