Skip to Content
avatar image
Former Member

Help with Script Logic - How to Convert Monthly time values to yearly time values (Dummy)?

Hi Experts,

I am trying to convert monthly time members to dummy yearly time members for example, 2017.01, 2017.02, 2017.03...so on to 2017.INPUT. Below is my script:

*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
*XDIM_MEMBERSET PLANTGRP = NOPLNTGRP
*XDIM_MEMBERSET VCACCNT = SALVOL


*FOR %YEAR% = %TIME_SET%.[YEAR]

*WHEN CATEGORY
*IS %CATEGORY_SET%
*REC(FACTOR = 1,TIME = %YEAR%.INPUT)
*ENDWHEN

*NEXT

I am trying to read the YEAR property of the monthly time members but its not working. The error that i get is for example, 2017.01.INPUT doesn't exist.

Could you please help?

Thanks & Best Regards,

Swakshar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 27, 2017 at 03:28 PM

    You have to use SELECT

    The script that will work for any combination of base members in %TIME_SET% will be:

    //%TIME_SET%=2016.01,2016.02,2017.01,2017.02,2017.03
    *SELECT(%YRS%,[YEAR],TIME,ID=%TIME_SET%) //%YRS%=2016,2016,2017,2017,2017
    *SELECT(%FMNTHS%,[ID],TIME,[YEAR]=%YRS% AND [PERIOD]=JAN) //%FMNTHS%=2016.01,2017.01
    *SELECT(%YS%,[YEAR],TIME,ID=%FMNTHS%) //%YS%=2016,2017
    
    *XDIM_MEMBERSET TIME = %TIME_SET%
    *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
    *XDIM_MEMBERSET PLANTGRP = NOPLNTGRP
    *XDIM_MEMBERSET VCACCNT = SALVOL
    
    
    *FOR %Y% = %YS% //for each year!
    
    *WHEN TIME.YEAR
    *IS %Y%
    *REC(FACTOR = 1,TIME = %Y%.INPUT)
    *ENDWHEN
    
    *NEXT

    P.S. This line in your script

    *FOR %YEAR% = %TIME_SET%.[YEAR]

    is using unsupported syntax, please read help: https://help.sap.com/viewer/a2049170bfeb4178ace32222842c3ec1/10.1/en-US/09ff556416444a6fbc99cefeec5f749c.html

    Add comment
    10|10000 characters needed characters exceeded