@Allocate - help needed

@Allocate - help needed

novice
novice

February 2nd, 2012, 11:39 am #1

Hi,

I have read docs regarding the @Allocate functions and frankly saying i am not quite understood the function and i am almost a novice too....

Can you guru's help me to explain with an example...

what i am trying is

my account name is "Accnt_1"

am loading some data into YearTotal level

and i want to spread to months i.e Jan to Dec.....

for eg. if i load 1200 into YearTotal, i want 100 in each months....

as far as i have read @Allocate funtion can be used for that, but not sure....

i can acheive the same by wrting, 12 lines of calc script for each month... :-)

pls help
Quote
Share

Charl du Toit
Charl du Toit

February 2nd, 2012, 11:46 am #2

@ALLOCATE and its infamous cousin @MDALLOCATE works, but I find it works quite slowly, and prefer to write my own allocation logic. So in your simple case, I would use something like the following in a calc script:

FIX(@LEVMBRS("Period",0))
"Accnt_1"("Accnt_1"->"YearTotal" / 12);
ENDFIX

So no need for 12 lines, one per month. If you start making clever use of @PARENTVAL and @ANCESTVAL you can get quite creative with your allocations.

However for very complex allocations @ALLOCATE and @MDALLOCATE does offer some neat tricks to do a lot in a single line of code, just be wary of the performance.
Quote
Share


Confirmation of reply: