on 07-22-2014 6:37 AM
Dear all,
I want to write script logic . It calculate the number of days in the month. But i don't know write statement in my script logic?
Thanks
Hi Hung,
Please explain, what do you mean by "calculate the number of days in the month"?
Do you have days in your YIME dimension?
How do you want to use the calculated value... etc...
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The easy way to have number of days in the month is to store this value in some combination of dummy members like:
TIME 2014.07
CATEGORY DUMMY
ENTITY DUMMY
ACCOUNT DAYS
AUDITID DUMMY
...
Value: 31
Then you can reference this value as a tuple expression:
([CATEGORY].[DUMMY],[ENTITY].[DUMMY],[AUDITID].[DUMMY],[ACCOUNT].[DAYS],[TIME].[2014.07])
Vadim
There is no way to calculate this! You have to store this value (31) somewhere.
Script logic is very limited, you can only test some condition:
*WHEN TIME.MONTHNUM
*IS 1
*REC(EXPRESSION=%VALUE%/31,ACCOUNT=SOMEACCOUNT)
*IS 2
*REC(EXPRESSION=%VALUE%/30,ACCOUNT=SOMEACCOUNT)
...
*ENDWHEN
But if you store the number of days using dummy members:
*WHEN SOMEDIM
*IS *
*REC(EXPRESSION=%VALUE%/([CATEGORY].[DUMMY],[ENTITY].[DUMMY],[AUDITID].[DUMMY],[ACCOUNT].[DAYS]),ACCOUNT=SOMEACCOUNT)
*ENDWHEN
Vadim
Sorry but I don't think this can be achieved by script logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
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.