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

write data into next year with script logic

Former Member
0 Likes
205

Hi,

I have a requirement whereby I have a script that my users can run via a data manager package. This script should take values from the period the user selects when running the script and write them to all periods of the following year. My script currently looks like this


*SELECT(%YR%,"[YEAR]",TIME,"[ID] = '%TIME_SET%'")

*XDIM_MEMBERSET ACCTDETAIL = F_CLO

*XDIM_MEMBERSET CATEGORY = Actual

*XDIM_MEMBERSET CONSOSCOPE = G_NONE

*XDIM_MEMBERSET CURRENCY = LC

*XDIM_MEMBERSET DATASRC = INPUT

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET ENTITY = %ENTITY_SET%

*WHEN ACCOUNT *IS BAS(1202300000)

*REC(EXPRESSION = %VALUE%, ACCOUNT = 1202309000, ACCTDETAIL = P_SUG, CATEGORY = Plan, INTCO = I_NONE,TIME = %YR%+1.01)

...

*ENDWHEN

The real script has twelve *REC lines, one per month. The problem is that the %YR%+1 does not return a value as I would expect. When a user runs this script for period 2015.08, the *REC tries to write data to 2015+1.01.

How can I write it, so that the year is calculated correctly?

Thanks,

Arnold

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

Hi Arnold,

Easy:

*SELECT(%YR%,"[YEAR]",TIME,"[ID] = '%TIME_SET%'")

...

*REC(EXPRESSION = %VALUE%, ACCOUNT = 1202309000, ACCTDETAIL = P_SUG, CATEGORY = Plan, INTCO = I_NONE,TIME = TMVL(1,%YR%.12))

...,TIME = TMVL(2,%YR%.12))

...

etc

Vadim

P.S. %YR%+1 is absolutely meaningless = 2016+1 etc

Only %YEAR% variable supports adding! %YEAR% is a special variable containing current year. I don't recommend using it!

Former Member
0 Likes

Thanks Vadim, works as expected

Answers (0)