Hi guys,
I’m trying to figure out how to make dynamic script which allows me to link the property of my ORDER dimension to ID in PROFITCENTER dimension. So basically, the challenge is, that I want values from a “source” profit center to be used on another profit center, but selected source profit center is depending on the specific order.
Here’s an example of my ORDER dimension
ID | Description | Profit Center | ProfitCenterLink |
ORDER1 | Route 2000 | 506 | 512 |
ORDER2 | Route 2140 | 506 | 519 |
ORDER3 | Route 2220 | 599 | 588 |
ORDER4 | Route 2160 | 599 | 534 |
Here’s an example of my PROFITCENTER dimension
ID | Description |
506 | Plant 1 |
599 | Plant 2 |
512 | Germany |
519 | Brazil |
534 | Holland |
588 | Sweden |
So instead of hard-coding like this, and having several statements:
*WHEN PROFITCENTER
*IS 506
*WHEN ORDERS. ProfitCenterLink
*IS 512
*WHEN ACCOUNT
*IS ROADSHARE
*REC(EXPRESSION = ((([ACCOUNT].[M3],[PROFITCENTER].[512])*[ACCOUNT].[ROADSHARE]),ACCOUNT = M3ROAD)
*WHEN PROFITCENTER
*IS 506
*WHEN ORDERS. ProfitCenterLink
*IS 519
*WHEN ACCOUNT
*IS ROADSHARE
*REC(EXPRESSION = ((([ACCOUNT].[M3],[PROFITCENTER].[519])*[ACCOUNT].[ROADSHARE]),ACCOUNT = M3ROAD)
Is it instead possible to write something dynamic, were only one statement is needed ala something like this:
*WHEN PROFITCENTER
*IS 506
*WHEN ORDERS. ProfitCenterLink
*IS [PROFITCENTER.ID]
*WHEN ACCOUNT
*IS ROADSHARE
*REC(EXPRESSION = ((([ACCOUNT].[M3],[PROFITCENTER]. [PROFITCENTER.ID])*[ACCOUNT].[ROADSHARE]),ACCOUNT = M3ROAD)
Bonus info: We are working on BPC 10 and upgrading to SP12 as we speak. I would like to use the script both for both pre-process and default.
Thanks