cancel
Showing results for 
Search instead for 
Did you mean: 

Skip January Month every year in Script logic calculation

Former Member
0 Kudos

Hi Friends,

The script below should not work for January Month and should work for rest of the Months for all Years. Could you pls. help how can I achieve this.

When i run the Data Package for January, this piece of logic should not work and should work for rest of the Months.

// POST NET PERIODIC VALUE

*XDIM_MEMBERSET TIME=$TIM$

*XDIM_MEMBERSET LOCATION=BAS(%LOCATION_SET%)

*XDIM_MEMBERSET KIT=BAS(ALL_KIT)

*XDIM_MEMBERSET KEYFIGURE=REVAL,PPV,UY,FOREX

*XDIM_MEMBERSET VERSION=ACTUAL

*XDIM_MEMBERSET DATASRC=YTDVAR

*WHEN TIME

*IS *

*REC(EXPRESSION=%VALUE%,DATASRC=PERIODVAR)

*ENDWHEN

*COMMIT

Thanks in advance,

Regards,

Venkat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Venkat,

You can update your script as below (changes in bold)-

*WHEN TIME.MONTHNUM

*IS <> 1

*REC(EXPRESSION=%VALUE%,DATASRC=PERIODVAR)

*ENDWHEN

Alternatively,  you could also write the script as -

*WHEN TIME.PERIOD

*IS <> JAN

*REC(EXPRESSION=%VALUE%,DATASRC=PERIODVAR)

*ENDWHEN

The *When statements in the above 2 examples will ensure that *rec is executed only when month is not equal to January.

Regards,

Shelly Jain

damovand
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I think using Vadim's select statement is better for performance.  The reason is that when you use the select statement you remove Jan at the beginning so you won't have to perform the test condition for each period.


In other words, you save time by performing one filtering action (the select statement) instead of executing the condition in WHEN statement many times (once for each period within the scope). 

*WHEN TIME.PERIOD

*IS <> JAN

Regards,

Leila

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks a lot Shelly, Vadim and Hendye..Worked perfect..

Regards,

Venkat

former_member196060
Contributor
0 Kudos

Check your time dimension properties such as LEVEL/MONTHNUM etc

former_member186338
Active Contributor
0 Kudos

Some extra variant

*SELECT(%T%,[ID],TIME,[ID]=$TIM$ AND [PERIOD]<>JAN)

*XDIM_MEMBERSET TIME=%T%

...

Vadim

And never use COMMIT with WHEN/ENDWHEN loop - absolutely useless.