on 07-12-2017 9:00 AM
Hello SAP Expert,
I’m trying (SAP BPC 10 MS) to perform the following calculation with SCRIPT Logic and I’m having some problems.
Basically what I want to achieve is to have YYYY.Q1 + YYYY.Q2 + YYYY.Q3 (ACTUALS) = YYYY.Q4 (FORECAST). I need to peform this for all years.
In my TIME dimension I have the properties PERIODS (with indicates for each ID Q1, Q2, Q3, Q4, JAN, FEB, MAR, etc) and the property YEAR as well.
In the script logic I have:
*SELECT (%Q1%,[ID],TIME, “PERIODS = Q1")
*SELECT (%Q2%,[ID],TIME," PERIODS = Q2")
*SELECT (%Q3%,[ID],TIME," PERIODS = Q3")
*SELECT (%Q4%,[ID],TIME," PERIODS = Q4")
*XDIM_MEMBERSET CATEGORY = ACTUALS
*WHEN CATEGORY
*IS ACTUALS
*WHEN TIME
*IS %Q1%,%Q2%,%Q3%
*REC(FACTOR = 1, CATEGORY = FORECAST, TIME = %Q4%)
*ENDWHEN
*ENDWHEN
*COMMIT
The problem that I’m having is that the system does not understand where the value must be stored. In NW version a similar procedure use to work for me.
Do you have any suggestion?
Thanks you!
Hi Luis,
Try something like this, i.e. add the SELECT statement and replace your REC statement with the FOR-NEXT loop below.
*SELECT(%ALL_YEARS%,"[YEAR]","TIME")
*WHEN TIME
*IS %Q1%,%Q2%,%Q3%
*FOR %MY_YEAR% = %ALL_YEARS%
*WHEN TIME.YEAR
*IS %MY_YEAR%
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.OCT, CATEGORY = FORECAST, NOADD)
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.NOV, CATEGORY = FORECAST, NOADD)
*REC(FACTOR = 1/3, TIME = %MY_YEAR%.DEC, CATEGORY = FORECAST, NOADD)
*ENDWHEN
*NEXT
*ENDWHEN
/Cecilia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.