Quantcast
Channel: SCN : All Content - SAP Planning and Consolidation, version for SAP NetWeaver
Viewing all articles
Browse latest Browse all 5457

Logic: Raise to the power of n

$
0
0

Hi,

 

In BPC10 NW, I’d like to write a script that takes an initial value for inflation (for example 10%) and raise it to the power of n, where n is the sequential number of the year currently in the loop. Say that I have 2014.INP and 2015.INP in my scope. 2014.INP would then become 1.1^1 = 1.1, and 2015.INP would be 1.1^2 = 1.21.

 

However, when I hard code n to 2, I get 0.3 as result. I’ve tested with other start values but it seems to be multiplying %value% by 3 rather than raising 1+%value% to the power of 2. Also, I don’t know how to dynamically get the value of n, i.e. to increase n by 1 for each loop.

 

 

*SELECT(%INP_YEARS%,"[ID]","TIME","[IS_INP_YEAR]= '1'")                      // All input years

 

*XDIM_MEMBERSET TIME = %INP_YEARS%,GENERAL.INP     // All input years

*XDIM_MEMBERSET ACCOUNT = AC.S.INFLATION

 

*WHEN TIME

*IS GENERAL.INP

*FOR %MY_YEAR% = %INP_YEARS%     // Loop on input years

*REC(FACTOR = (1 + %VALUE%) ^ n, TIME = %MY_YEAR%)   // How do I get value of n to increase by 1 for each loop?

*NEXT

*ENDWHEN

 

 

Anyone knows how to achieve that?

 

/Cecilia


Viewing all articles
Browse latest Browse all 5457

Trending Articles



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