on 05-15-2006 12:28 AM
Hi Gurus,
how can i implement the logic below in a global definition of a query
IF 'A' > B' THEN 0
OTHERWISE as below
"( 1 - A' / B' ) * 100"
Highlighted in double quots is the current calc for the key figure..
Ur reply will be appreciated. Thank u
Dave
Hi Dave:
Create a New Calculated Key Figure. In the formula, write this Code:
(A>B)(0) + (NOT(A>B))((1-(A/B))*100))
Let me know if you find any issues.
Good day
Ram Chamarthy
Message was edited by: Ram Chamarthy
Message was edited by: Ram Chamarthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can also write as:
(A>B)0 + (A<=B)((1-A/B)*100)
shylaja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dave:
I don't worry about points.
If I am missing a bracket, your BEX Query Designer will correct it. Its pretty good with syntax (unlike ABAP).
When you completed the Code in BEx, let me know.
Good luck
Ram Chamarthy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dave:
I already finished. Ask me any particular part if you want to.
Write the Code & let me know.
Good day
Ram Chamarthy
Message was edited by: Ram Chamarthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dave,
Nothing further is needed.
BEx logic is a little different from ABAP:
If you read carefully, u will get the logic.
I will explain further in a minute:
RESULT = Part-1 + Part-2
Case A>B:
Part-1
(A>B)*(0)
A>B, so the condition = 1 . Result of first part = 1*0 = 0.
Part-2
(NOT(A>B))((1-(A/B))100))
Here, the condition = 0 because of NOT. So, the result = 0
RESULT = 0 + 0.
Case A<B or A=B:
Part-1
(A>B)*(0)
the condition = 0 . Result of first part = 0*0 = 0.
Part-2
(NOT(A>B))((1-(A/B))100))
Here, the condition = 1 because of NOT.
So, the result is what you want
RESULT = 0 + Part-2.
Yes, its pretty neat.
Ram Chamarthy
Message was edited by: Ram Chamarthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.