on 03-17-2017 2:16 PM
Hi All,
Can anyone please brief me below logic.i am bit confused on below logic in sap bex query formula
((A==0)*1+0)*(B-C)
with warm regards,
Giri
Hi,
Antonio's explanation above is correct.
You can just use his formula.
(A==0) * (B-C)
But sometimes having multiple elements.
So what you can do is store first the B-C in a FORMULA.
TEST_FORMULA = B - C
Then apply it to your condition formula.
(A==0) * TEST_FORMULA
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Giri,
a condition is 1 if it's true, otherwise 0. In your example:
if content of A = 0, the condition is true (equal 1) and the result will be (1*1+0)*(B-C) = B-C.
if content of A <> 0, the condition is false (equal 0) and the result will be (0*1+0)*(B-C) = 0.
You can have the same result with the following formula: (A==0) * (B-C).
In general, if-then-else is made in Bex in this way:
if A = x
then B
elseif A = y
then C
else D
in Bex
(A==x)*B + (A==y)*C + (A<>x * A<>y)*D
Best regards,
Antonio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.