on ‎2016 Aug 13 12:47 AM
Hello Experts,
I am doing a script logic to Calculate budget for year +1 based on present year. I'm running the script in tx ujkt and I see a difference between the LG file and the LOG:
LG File
LOG
As shown in the images my scope is fine, but in the log it changes.
I'm trying to calculate 01.2017 = 01.2016, 02.2017=02.2016, 03.2017=03.2016. This to test and then add the factor. But what it seems the Script does is to 01.2017= 01.2016+02.2016+03.2016 ; 02.2017= 01.2016+02.2016+03.2016; 01.2017= 03.2016+02.2016+03.2016.
Why is the scope changed when executing the Data Manager?
Any Ideas?
Regards
Request clarification before answering.
Hi Sebastian,
The script is incorrect!
I have already provided you the correct script:
*FOR %T%=%PERIODO_SET%
*XDIM_MEMBERSET PERIODO=TMVL(-12,%T%)
*WHEN ...
*REC(...,PERIODO=%T%)
*ENDWHEN
*NEXT
Single FOR/NEXT!!!
P.S. The Log is absolutely correct according to the script you created
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a solution with single WHEN/ENDWHEN loop (assuming that all members selected by user are from the single Year):
*SELECT(%YS%,[YEAR],PERIODO,[ID]=%PERIODO_SET%)
*SELECT(%M1%,[ID],PERIODO,[YEAR]=%YS% AND [PERIOD]=JAN)
*SELECT(%Y%,[YEAR],PERIODO,[ID]=%M1%)
*XDIM_MEMBERSET PERIODO= //to clear the original scope!!
*FOR %T%=%PERIODO_SET%
*XDIM_ADDMEMBERSET PERIODO=TMVL(-12,%T%)
*NEXT
*WHEN PERIODO.PERIOD
*IS JAN
*REC(FACTOR=1,PERIODO=01.%Y%)
*IS FEB
*REC(FACTOR=1,PERIODO=02.%Y%)
*IS MAR
*REC(FACTOR=1,PERIODO=03.%Y%)
...
*ENDWHEN
may be faster but not sure!
Your 3 XDIM_ADDMEMBERSETs are adding 3 more month into the scope. Now your WHEN statement takes all 6 periods and adds them into 1. You probably don't have any data in 2016 that's why it adds only 3 periods of 2017 and not all 6.
You can change your script the way Vadim suggested or you can add WHEN TIME in your WHEN statement and restrict it to a single month.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 16 | |
| 8 | |
| 7 | |
| 6 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.