on 07-16-2014 9:30 PM
Hello:
I'm new on script logic and MDX sintaxis.
I need to built an script logic for a pxq calculation using this considerations:
For each material (0material):
Price: account dimension member P_001 - Stored only in one month 2014.JAN
Quantity: Account dimension member P_002 - Stored monthly 2014.JAN, 2014.FEB....2014.DIC
PXQ: stored the result in the account dimension member according to the property "CUENTA"of the respective material.
Please Help.
Thank you in advance.
Luciana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer:
BPC 10 NW 801 SP 4
Dimension of the model: ACCOUNT (A), TIME (T), CATEGORY (C), ENTITY (E), CURRENCY (R), MATERIAL (User Def)
In the ACCOUNT dimension there are members PRICE (EXP),QUANTITY (EXP), OTHERS ACCOUNTS (EXP).
I need to built an script logic for a pxq calculation using this considerations:
For each material:
Price: account dimension member P_001 - Stored only in one month 2014.JAN
Quantity: Account dimension member P_002 - Stored monthly 2014.JAN, 2014.FEB....2014.DIC
PXQ: the result has to be stored in a respective account. Each material has an account assigned in a property called "CUENTA".
In the image attached yo can see the example:
The user will input Price for one month and quantity for the complete year.
The cell in red are the pxq calculations stored in the respective account according to the material property.
Thank you Vadim.
Luciana
OK, then it's better to ask user to select Year with COMBOBOX prompt:
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%")
PROMPT(COMBOBOX,%Y%,"Select Year:",0,,{2013,2014,2015,2016,2017})
INFO(%EQU%,=)
INFO(%TAB%,;)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,Y%EQU%%Y%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,SCRIPTNAME.LGF)
The script will be:
//$Y$ - DM variable will contain year selected by user
*XDIM_MEMBERSET ENTITY=%ENTITY_SET% //xxxxx - from SELECTINPUT
*XDIM_MEMBERSET ACCOUNT=P_002 //quantity
*XDIM_MEMBERSET TIME=$Y$.JAN,$Y$.FEB,$Y$.MAR...$Y$.DEC //list all months
*WHEN ACCOUNT
*IS * //scoped
*REC(EXPRESSION=%VALUE%*([TIME].[$Y$.JAN],[ACCOUNT].[P_001]),ACCOUNT=MATERIAL.QUENTA) //tuple expression used for price
*ENDWHEN
Vadim
What do you mean by "restrict the quantity for the zero values"? Business case is not clear!
Quantity can be:
1. No record at all -> nothing will be selected in when/endwhen - nothing written
2. zero record (user cleared previous non zero value) -> zero will be written to destination.
3. non zero -> result of multiplication will be written
zero records will be deleted when light optimization will be done with zero elimination enabled...
Vadim
Looks not very logical:
1. User entered price and monthly quantities.
2. DM package was launched and calculated result stored.
3. Then user decided to correct monthly quantities and changed some values to zero.
4. You want DM to ignore this changes????
Vadim
P.S.
I can even recommend clearing everything in destination before calculation to ensure that zero elimination do not clear some records. The idea is to ensure consistency between price, quantity and result.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.