Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for the Microsoft platform
Viewing all articles
Browse latest Browse all 1545

Simplify logic script

$
0
0

I want to update an existing package by adding a new section to take the actual dollars from a 12 month period and copy the total to the month and category selected when the package is run.

 

Right now I am scoping the time by listing each period like so:

*XDIM_MEMBERSET TIME = period1,period2,period3,...period12

 

Then I am basically repeating the same steps in the WHEN block:

*WHEN TIME
  *IS "period1","period2","period3",..."period12"
    *REC(EXPRESSION=%VALUE%,TIME=%TIME_SET%,CATEGORY="%CATEGORY_SET%")
*ENDWHEN

 

This works OK but requires someone to manually update the periods each time we run the package.  What I would like to do is rewrite the logic so it does not require the manual update each time the package is run.

 

Is it possible to use a SELECT statement to determine my 12 month period?  It would be the month selected when the package is run, plus the 11 months prior to that.  For example, if the user selected MAR2014, it would be the 12 month period from APR2013 - MAR2014.

 

I imagine it would look something like below but for the SELECT statement but I don't know how to get the other 11 months.

*SELECT(%TWELVEMONTHS%, "[ID"], "TIME", "[ID] = '%TIME_SET%' AND ????")

 

Once I have the variable populated, would the syntax below work for the WHEN block?

*XDIM_MEMBERSET TIME = %TWELVEMONTHS%

 

*WHEN TIME
  *IS "%TWELVEMONTHS%"
    *REC(EXPRESSION=%VALUE%,TIME=%TIME_SET%,CATEGORY="%CATEGORY_SET%")
*ENDWHEN

 

Regards


Viewing all articles
Browse latest Browse all 1545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>