Let's assume we have an outline that looks like the one below. This is based off of Sample.Basic, with a few minor adjustments.
Assume we had an allocation from our old Sample Basic cube which was taking last year's Marketing spend and spreading it to this year's Marking budget based upon last year's sales by market. You can see how the data looks below. In this case the $843 gets spread to the various markets in direct proportion to what the market's sales were.
The Old Way
The BSO calc script to do this could use the @ALLOCATE function as below.1: FIX("Marketing")
2: "Budget" = @ALLOCATE("PY Actual, @LEVMBRS("Market",0),"PY Actual"->"Sales",,share);
3: ENDFIX
Translating to ASO
The most basic difference between a BSO Calc Script and an ASO Allocation is that the former is a file that can be executed in a number of ways: via MaxL, through Smart View, through EAS, etc. and the latter is a MaxL statement. This is the process for creating my MaxL statement.The first thing I need to do is to start my execute statement specifying the database name.
1: Execute Allocation Process on Database ASample.Basic with
Next I need to define my POV. I use the CrossJoin function to define the Range the allocation will be run on. In this case all Level 0 products and all 12 months.
2: POV "CrossJoin([Jan]:[Dec],
3: {Descendants([Total Products],Levels([Product],0))})"
Now I need to set the AMOUNT I am using in the allocation. In this case it is the Marketing dollars from last year for all Markets. That can be represented using a tuple.
4: AMOUNT "([Market],[PY Actual],[Marketing])"
Then I will set the BASIS by which the data will be spread. In this case the PY Actuals, Sales tuple.
5: BASIS "([PY Actual],[Sales])"
I will define my TARGET with a tuple pulling data from the intersection of the Budget Scenario and Marketing Measure.
6: TARGET "([Budget],[Marketing])"
7: RANGE "{Descendants([Total Markets],Levels([Market],0))}"
Finally I will specify the Allocation method. In this case I will use SHARE. You can use SPREAD if you want to allocate the data values evenly. If you do use SPREAD then make sure to drop the BASIS (simply remove line 5 from the statement) as it doesn't make sense to use a BASIS when allocating evenly.
8: SHARE;
Hopefully when you execute, you'll see the following messages telling you the elapsed time and how many cells were created.
OK/INFO - 1300006 - Essbase generated [5] cells.
OK/INFO - 1013374 - The elapsed time of the allocation is [0.13] seconds.
OK/INFO - 1241188 - ASO Allocation Completed on Database ['ASample'.'Basic'].
No comments:
Post a Comment