on 07-19-2014 9:34 AM
Hi,
I am trying to learn the script logic and facing this issue :
I want to calculate : ACCOUNT A = ACCOUNT B + ACCOUNT C.
FOR THIS I HAVE DEFINED THE SCRIPT LIKE THIS :
*XDIM_MEMBERSET CATEGORY = BUDGET
*XDIM_MEMBERSET TIME = %TIME_SET%
*WHEN ACCOUNT
*IS "B"
*REC(EXPRESSION = (%VALUE%)+[ACCOUNT].[C],ACCOUNT = "A")
*ENDWHEN
The code is getting validated successfully and when I am running it then following are the cases which I am getting :
In Excel Input Form if I enter : ACCOUNT B = 10 , ACCOUNT C = 10 THEN THE ACCOUNT A = 20 , which is correct and its working.
But when I enter the data in such way : ACCOUNT B = ,ACCOUNT C = 10 ,ACCOUNT A = 0. It should show 10 but its not because I kept Account B blank this time.
So, my query is if above way is not correct then Please guide me how I can script : ACCOUNT A = ACCOUNT B + ACCOUNT C , so that it shows result in all condition even when any of the member account is blank .
Please guide.
Thanks
NATASHA
Hi Natasha,
2 WHEN/ENDWHEN loops required
If it's default.lgf then (no XDIM_MEMBERSET!):
*WHEN CATEGORY
*IS BUDGET
*WHEN ACCOUNT
*IS "B"
*REC(EXPRESSION = %VALUE%+[ACCOUNT].[C],ACCOUNT = "A")
*ENDWHEN
*ENDWHEN
*WHEN CATEGORY
*IS BUDGET
*WHEN ACCOUNT
*IS "C"
*REC(EXPRESSION = %VALUE%+[ACCOUNT].[B],ACCOUNT = "A")
*ENDWHEN
*ENDWHEN
If this script is DM package, then:
*XDIM_MEMBERSET CATEGORY = BUDGET
*XDIM_MEMBERSET ACCOUNT= B
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION = %VALUE%+[ACCOUNT].[C],ACCOUNT = "A")
*ENDWHEN
*XDIM_MEMBERSET ACCOUNT= C
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION = %VALUE%+[ACCOUNT].[B],ACCOUNT = "A")
*ENDWHEN
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The syntax exists:
*WHEN_REF_DATA = MASTER_DATA //loop all members including empty
To be placed before WHEN/ENDWHEN
But this statement affects all dimensions and the resulting performance will be terrible.
In most cases it's better to repeat WHEN/ENDWHEN loops.
Also, for DM package and simple sum of accounts you can use code in my second post (not for default.lgf)
Vadim
User | Count |
---|---|
15 | |
4 | |
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.