Hi,
I still haven't figured out how to assign a userdefined variable in a script.
My case is that I in my script commits data several times, after every commit I need to do a new *XDIM_MEMBERSET. Every time the *xdim_memberset is exactly the same.
Example - what I do now.
*XDIM_MEMBERSET ACCOUNT="REVENUE"
*XDIM_MEMBERSET VERSION="90"
*rec
*commit
*XDIM_MEMBERSET ACCOUNT="REVENUE"
*XDIM_MEMBERSET VERSION="90"
*rec
*commit
Etc.
It would be much easier, if I the beginning of each script for Account and Version defined a variable, and then having every *xdim_memberset use the variable. Then I only need to change the definition of the variable in the beginning of each script.
Example - what I want to achieve.
//Definition of constant variables.
%ACCOUNT_VARIABLE%= "ACCOUNT = REVENUE"
%VERSION__VARIABLE% = "VERSION=90"
*XDIM_MEMBERSET %ACCOUNT_VARIABLE%
*XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
*rec
*commit
*XDIM_MEMBERSET %ACCOUNT_VARIABLE%
+*XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
*rec
*commit
I've looked at the *SELECT and *MEMBERSET - but can't really get the syntax to work.....
Thank you,
Joergen
Edited by: Jørgen Dalby Andersen on Dec 30, 2011 7:58 AM
Request clarification before answering.
Hi Joergen,
Unlike MS version NW writes data back to DB on ENDWHEN, so you don't need COMMIT, hence no need for those additional XDIM_MEBERSETs.
Hope this helps.
Gersh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I managed to get the syntax correct.
//Definition of constant variables.
*SELECT(%ACCOUNT_VARIABLE%, [ID], ACCOUNT,ID="REVENUE")
*SELECT(%VERSION_VARIABLE%, [ID], VERSION,ID="90")
*XDIM_MEMBERSET ACCOUNT=%ACCOUNT_VARIABLE%
*XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
*rec
*commit
*XDIM_MEMBERSET ACCOUNT=%ACCOUNT_VARIABLE%
*XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
*rec
*commit
Regards,
Joergen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you can use *SELECT statement . *MEMBERSET can be used in MS not in NW .
Syntax for *SELECT statement is below . There are some limitations in the condition.
*SELECT(%ACCT_VAR%, u201CIDu201D, u201CACCOUNTu201D, u201C[ID] = 'REVENUE'u201D)
*SELECT(%ACCT_VAR%, u201Cproperty that is to be in variableu201D, u201Cdimension nameu201D, u201Cconditionu201D).
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pkrishnas,
thank you for your reply.
Would you by any chance also now how to limit to basemembers in a hierarchy in the select statement ?
I've tried the following syntax - but no luck.
*SELECT(%TEST%, [ID], ACCOUNT,ID=BAS(REVENUE))
Then the account hierarchy is for example like this:
Parent = REVENUE
Base = netsales and discount
And I try to get the *select statement to "filter" to netsales and discount.
Thank you,
Joergen
Hi,
when I use *XDIM_MEMBERSET ACCOUNT AS %TEST% = BAS(REVENUE) - it work fine.
BUT ! after my first commit, it seems like the variable value is lost. And the *Xdim_memberset takes all.....
Fortunately enough, *select still contains the variable value after *commit.
Thanks,
Joergen
*Correction !
It actually works, it still contains the variable value after commit !!
Edited by: Jørgen Dalby Andersen on Dec 30, 2011 1:33 PM
| User | Count |
|---|---|
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 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.