on 12-18-2011 12:23 AM
hi friends
Pl find enclosed the following code:
*WHEN TIME
*IS TMVL(-1,2011.04)
*WHEN ACCOUNT
*IS "EXP01"
*REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = EXP01A)
*ENDWHEN
*ENDWHEN
The above code is working fine and result is extracted but i have hardcoded , ACCOUNT=EXP01A;
My Query is follows:
I have used
*WHEN ACCOUNT
*IS "EXP01"
In REC i want to use concatenation of "A" To account like EXP01&"A"
i know account & i want to concatenate "A" and use in REC statement like assign to variable
var1="EXP01" & "A" and use var1 in REC
*REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = var1)
i am not sure the syntax (Whether we need to put in strings)
Also if EXP02 then var1="EXP02"&"A" and so on
In fact i want to make this for all members in Account Dimenstion as generalised.
Pl. verify and suggest best possibility
Thanx & Rgds
Srinath
For concatenation , string that is to be appended,should be placed next to the member either it is static or dynamic .For example ,if %VAR1% has EXP01 , to append A ,syntax for concatenation is %VAR1%A . Sample code is below.
*XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01
*WHEN ACCOUNT
*IS %ACC%
*REC(EXPRESSION = %VALUE%*2,TIME = 2011.04,ACCOUNT = %ACC%A)
*ENDWHEN
If above code needs to be generalised, *FOR *NEXT can be used .
*XDIM_MEMBERSET ACCOUNT AS %ACC_LIST% = EXP01,EXP02,EXP03,EXP04
*FOR %ACC_MBR% = %ACC_LIST%
*WHEN ACCOUNT
*IS %ACC_MBR%
*REC(EXPRESSION = %VALUE%*2,TIME = 2011.04,ACCOUNT = %ACC_MBR%A)
*ENDWHEN
*NEXT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna
*XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01
*WHEN ACCOUNT
*IS %ACC%
REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC%A)
*ENDWHEN
Is it required to add EXP01A as below?
XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01, EXP01A
Also In Generalized code you have mentioned:
Instead of Hard Coding EXP01, EXP02 can i have hierarchy of all EXP , so that if any new account added in dimension, there will be no change in script logic. Pl. can you share how to use the same.
If above code needs to be generalised, *FOR *NEXT can be used .
*XDIM_MEMBERSET ACCOUNT AS %ACC_LIST% = EXP01,EXP02,EXP03,EXP04
*FOR %ACC_MBR% = %ACC_LIST%
*WHEN ACCOUNT
*IS %ACC_MBR%
REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC_MBR%A)
*ENDWHEN
*NEXT
Rgds
Srinath
User | Count |
---|---|
16 | |
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.