cancel
Showing results for 
Search instead for 
Did you mean: 

Time Hierarchy - Logic

frederico_lapa
Explorer
0 Kudos

Hi All!

I am trying to use a script for calculate the sales units weight of the months in the year.

For example:

Month /Sales Units

2009.JAN / 10.000

2009.FEV / 12.000

u2026

2009.DEC / 25.000

Total Sales Units Year = 200.000

The idea is:

1- The user select the time periods - a full year - (2009.JAN, u2026, 2009.DEC)

2- A logic function calculates the weight:

a. 2009.JAN = 0.05

b. 2009.FEV = 0.06

c. u2026

d. 2009.DEC = 0.125

3- Let the user modify the weights in an input schedule and adjust the sales units in the next step.

Here it is my script logic to implement the step 2:

*XDIM_MEMBERSET SalesAccount=SalesUnits

*CALC_DUMMY_ORG TIME=LEVEL

*WHEN TIME

*IS #MONTH

*REC(EXPRESSION=%VALUE%/GET(TIME=#YEAR),SalesAccount="MONTHWEIGHT")

*ENDWHEN

*COMMIT

But this is not working...

Any help is appreciated!

Regards, Fred

View Entire Topic
frederico_lapa
Explorer
0 Kudos

Hello All!

The problem was solved with the RUNALLOCATION function.

See the code below.

*RUNALLOCATION

//The USING/USING brings the sales units (month) and was the way I found to handle with

//the FACTOR instruction: as you know is (the amount of the WHAT region) * (the amount of the

//USING region) / 100

*FACTOR=USING/USING/TOTAL

*DIM TIME WHAT=BAS(%YEAR%.TOTAL); WHERE=<<<; USING=<<<; TOTAL=%YEAR%.TOTAL

*DIM SalesAccount WHAT=SalesUnits; WHERE=MonthWeight

*ENDALLOCATION

*COMMIT

Frederico