Skip to Content
0
Jun 19, 2018 at 04:59 AM

Logic script - Current year and next year

560 Views

Hello,

I am working on a script to copy the data to forecast versions. Forecast is monthly so copy should work for open periods of current year and next year. Current year = 2018 and next year is 2019

I am able to read the open months of the current year however select statement to read next year values is not giving any result

//Select statement to retrieve the current Forecast period of the year, from the property CURR_PER and member ID FCAST_INPUT, value set is 2018.06

*SELECT(%CURR_PER%,"[CURR_PER]",VERSION,"[ID]"='FCAST_INPUT')

*SELECT(%T_CURR_PER%,[ID],TIME,"[ID]"=%CURR_PER%) // Time ID linked to Forecast Time period

*SELECT(%T_CURR_YR%,[YEAR],TIME,"[ID]"=%T_CURR_PER%) // to get current Year

*SELECT(%T_CURR_YR_FCST_PER%,[ID],TIME,"[YEAR]"=%T_CURR_YR% AND "[CALC]" = 'N' AND "[ID]" > %T_CURR_PER%) // to read current year open forecast periods

all the above statement working as expected

I have below select statement to read Next year periods -

*SELECT(%T_NEXT_YR_PER%,[ID],TIME,"[YEAR]"=%T_CURR_YR%+1 AND "[CALC]" = 'N')

This statement is not being read at all ...is this a valid statement?

I am using the variable in Time as

*XDIM_MEMBERSET TIME = %T_CURR_YR_FCST_PER%, %T_NEXT_YR_PER%

In the result I see 2018.07,2018.08,2018.09,2018.10,2018.11,2018.12 only, nothing from the year 2019

Please advice