on ‎2015 Sep 11 10:31 AM
Hello,
I have a requirement from a client that I want to implement in script logic, however all the approaches I've tried don't work.
The rule is fairly simple, to calculate the monhtly budget values based on the actual values of the previous year and a growth rate that is stored in the months of the budget year.
Example (only for the first 3 months of the year to simplify:
ACTUAL_VALUES GROWTH_RATE BUDGET_VALUES
2014 Jan 100
2014 Feb 200
2014 Mar 500
2014 Apr 350
2015 Jan 0,1 10
2015 Feb 0,6
2015 Mar 0,3
2015 Apr 0,4
I'm trying with the following script logic in the transaction UJKT, but I've only managed to perform the calculation correctly for one month. I need to insert a data region for the PERIOD dimension, but when I add more than one month (for example PERIOD = 2014.01,2014.02,2014.03,2014.04) the calculation only consider one of the months in the %PERIOD_SET% and stores everything in the same month.
*XDIM_MEMBERSET RUBRICA_INV_DIV = ACTUAL_VALUES, BUDGET_VALUES
*WHEN RUBRICA_INV_DIV
*IS ACTUAL_VALUES
*REC(RUBRICA_INV_DIV= BUDGET_VALUES,PERIOD = TMVL(12,%PERIOD_SET%), EXPRESSION = %VALUE% * ([RUBRICA_INV_DIV].[GROWTH_RATE],[PERIOD].[TMVL(12,%PERIOD_SET%)]))
*ENDWHEN
*COMMIT
I need to use the ACTUAL_VALUES in the WHEN command because this account has other details in other dimensions, that the growth rate doesn't have and I need it in the budget results.
Can anyone help me please?
Thanks!
Request clarification before answering.
Hi Lara,
Easy!
*XDIM_MEMBERSET RUBRICA_INV_DIV=ACTUAL_VALUES //Don't scope target - useless!
*FOR %PER%=%PERIOD_SET%
*WHEN RUBRICA_INV_DIV
*IS * //ACTUAL_VALUES
*REC(EXPRESSION=%VALUE% * ([RUBRICA_INV_DIV].[GROWTH_RATE],[PERIOD].[TMVL(12,%PER%)]),RUBRICA_INV_DIV= BUDGET_VALUES,PERIOD = TMVL(12,%PER%))
*ENDWHEN
*NEXT
//Don't use useless COMMIT!
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create a property like NEXTYEARPER and fill it:
ID NEXTYEARPER
2014.01 - 2015.01
2014.02 - 2015.02
...
Then you can use the following script:
*LOOKUP CuurentModel //use real name!
*DIM NY: PERIOD=PERIOD.NEXTYEARPER
*DIM RUBRICA_INV_DIV="GROWTH_RATE"
*DIM MEASURES=PERIODIC //Or YTD - what is the default MEASURE of Current Model
*ENDLOOKUP
*XDIM_MEMBERSET MEASURES=PERIODIC //Or YTD - what is the default MEASURE of Current Model
*XDIM_MEMBERSET RUBRICA_INV_DIV=ACTUAL_VALUES
*WHEN RUBRICA_INV_DIV
*IS * //ACTUAL_VALUES
*REC(EXPRESSION=%VALUE% * LOOKUP(NY),RUBRICA_INV_DIV= BUDGET_VALUES,PERIOD = PERIOD.NEXTYEARPER)
*ENDWHEN
Vadim
P.S. Lines with MEASURES are required...
Hello Vadim,
In SAP BPC NW 10 it is not possible to define multiple lookup keys inside the same lookup?
For a similar calculation, I need to use the growth rate stored in 2015 Dec and 2016 Dec, so I tried to use your approach, like this:
*LOOKUP CuurentModel
*DIM NYFIRST: PERIOD=2015.12
*DIM NYSECOND: PERIOD=2016.12
*DIM RUBRICA_INV_DIV="GROWTH_RATE"
*DIM MEASURES=PERIODIC
*ENDLOOKUP
*XDIM_MEMBERSET MEASURES=PERIODIC
*XDIM_MEMBERSET RUBRICA_INV_DIV=ACTUAL_VALUES
*WHEN RUBRICA_INV_DIV
*IS *
*REC(EXPRESSION=%VALUE% * LOOKUP(NYFIRST) * LOOKUP(NYSECOND)),RUBRICA_INV_DIV= BUDGET_VALUES)
*ENDWHEN
But the result is null. I've performed other tests and it seems that the only lookup that has retrieves values in the one defined last, in this case NYSECOND. If I change the order (like below), the one with value is NYFIRST.
*LOOKUP CuurentModel
*DIM NYSECOND: PERIOD=2016.12
*DIM NYFIRST: PERIOD=2015.12
*DIM RUBRICA_INV_DIV="GROWTH_RATE"
*DIM MEASURES=PERIODIC
*ENDLOOKUP
Is this the usual behavior? Are there any workaround?
Thanks!
Lara
| User | Count |
|---|---|
| 17 | |
| 7 | |
| 7 | |
| 6 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.