on 07-04-2012 1:04 PM
Hi all,
I know I can use nested *WHEN statements such as
*WHEN ACCOUNT
*IS A
*WHEN CATEGORY
*IS XY
*REC
*ENDWHEN
*ENDWHEN
But should nested *WHEN statements such as this one work?
*WHEN ACCTDETAIL
*IS F_CLO
*WHEN SIGNEDDATA
*IS < 0
*WHEN ACCTDETAIL
*IS F_OPE
*WHEN SIGNEDDATA <0
*REC
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
And secondly, if I use *WHEN SIGNEDDATA with three cases:
*WHEN ACCTDETAIL
*IS F_CLO
*WHEN SIGNEDDATA
*IS < 0
*REC
*IS = 0
*REC
*IS > 0
*REC
*ENDWHEN
*ENDWHEN
would the case where there is no entry in the fact table for F_CLO (for example after an optimisation of because no data has been entered) be captured by the *IS = 0 or do I need an *ELSE?
Thanks,
Arnold
Hi Arnold,
for the first question I don't think it will work, you must try, but you can rewrite the test in a more simple way
*WHEN SIGNEDDATA
*IS < 0
*WHEN ACCTDETAIL
*IS F_CLO
...
*IS F_OPE
...
*ENDWHEN
*ENDWHEN
for the second there are nested *WHEN, that means that the Signeddata tests are inside the Accdteail test so you need and *ELSE.
Kind regards
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roberto,
My script above was a shortened example. Let's say I have to members in my ACCTDETAIL dimension, F_CLO and F_OPE and each can be a positive or negative value or a zero value. What I am looking to do with my script is to check for each possible combination
F_CLO F_OPE
0 0
0 +
0 -
+ 0
+ +
+ -
- 0
- +
- -
So my idea was to check for F_CLO = 0 first and then each of the possible values of F_OPE. I have tested this idea and it doesn't work so I've come up with a different solution.
Thanks,
Arnold
Hi Arnold,
For the first case, the script is trying to check if a record has two members within a dimension-ACCTDETAIL. This is not possible. However you can try using
For the second case, you must use *ELSE to proceed further, since there are no records to compare with signeddata.
Karthik AJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also combine the GET in a WHEN using a + operator:
i.e.
*WHEN GET(ACCTDETAIL="F_CLO")+GET(ACCTDETAIL="F_OPE")
*IS > 0
*IS < 0
*IS 0
*ENDWHEN
Also note that you need to consider the ACCTYPE of the accounts you are scoping since INC/LEQ accounts are stored as negative values in the database.
Remember there are many way to skin a cat with BPC script logic
Thanks,
John
User | Count |
---|---|
15 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.