Hi All
We have a requirement to calculate gross margin as follows:
Formula : Gross Margin $ = Sales Output * Sales Gross Margin %
My script logic below:
*XDIM_MEMBERSET MEASURES = PERIODIC
*XDIM_MEMBERSET S_ACCOUNT = A_OUTPUT, A_OUTPUTGM
*WHEN S_ACCOUNT
*IS A_OUTPUT
*REC(FACTOR = ([S_ACCOUNT].[A_OUTPUTGM]),S_ACCOUNT = A_GMARGIN,DATASRC = D_CALC)
*ENDWHEN
*WHEN S_ACCOUNT
*IS A_OUTPUTGM
*REC(FACTOR = ([S_ACCOUNT].[A_OUTPUT]),S_ACCOUNT = A_GMARGIN,DATASRC = D_CALC)
*ENDWHEN
However:
The Current code only works when the S_ACCOUNTS are saved to the same time unit 2015.01.
In reality/Going forward, data will be saved to the following time members:
- Sales output is saved to base time members, EG 2015.01, 2015.02.
- Sales Gross Margin % is saved to a representative base time member, representing the entire year. (2015.TOTAL.BASE)
I need to modify the code to:
1/ Include the time members in the ‘selection’ and ’record’ sections of the script. When I switch the A_OUTPUTGM from 2015.01 to 2015.TOTAL.BASE in the input schedule above, the script logic doesn’t work.
2/ Enable the time members in the ‘selection’ and ‘rec’ areas of the script to be dynamic, ie the model is used quarterly across different years, so the time unit needs to cater for this.
Pls see the attached files for the back ground and images of the current and required input templates.
Thanks for any assistance!!
Glen