cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Why the difference btw LG File and Log.

former_member182305
Active Participant
0 Likes
264

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

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

former_member182305
Active Participant
0 Likes

Thank you very much Vadim, I thought the for was just for the scope and the I will need an aditional for.

Just 1 For and 1 When were needed.

Thanks again.

Best Regares.

former_member186338
Active Contributor
0 Likes

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!

Answers (1)

Answers (1)

Former Member
0 Likes

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.