on 2019 Nov 01 11:27 PM
We are having ACCOUNT dimension having
ACC_A
ACC_B,
We also have DEPT dimension where
DEPALL is parent of
DEPA,
DEPB,
DEPC
We want to use value of ACC_A for each base member of DEPT dimension and divide it by value of ACC_A of DEPALL and store the result into ACC_B
*XDIM_MEMBERSET ACCOUNT= ACC_A, ACC_B
*XDIM_MEMBERSET DEPT=BAS(DEPALL)
*WHEN ACCOUNT
*IS ACC_A
*WHEN DEPT
*IS %DPT%
*REC(S_ACCOUNT=ACC_B,EXPRESSION=( %VALUE% / %DPT%.PARENT ))
*ENDWHEN
*ENDWHEN
However not able to get the required result. What we need is ACC_A Value at base level of DEP divided by ACC_A Value at Parent of that DEP and store it into ACC_B.
Thanks... will check this out and update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to manually create a list of departments:
*XDIM_MEMBERSET S_ACCOUNT= ACC_A
*FOR %DEP%=DEP_PARA,DEP_PARB //list of departments
*XDIM_MEMBERSET DEPT=BAS(%DEP%) //scope base members of department
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/[DEPT].[%DEP%],S_ACCOUNT=ACC_B)
*ENDWHEN
*NEXT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As an alternative, you can create a property IS_DEPT and fill it with "Y" for department parent members like: DEP_PARA, DEP_PARB
Then:
*SELECT(%DEPS%,ID,DEPT,IS_DEPT=Y) //%DEPS% - list of departments
*XDIM_MEMBERSET S_ACCOUNT= ACC_A
*FOR %DEP%=%DEPS%
*XDIM_MEMBERSET DEPT=BAS(%DEP%) //scope base members of department
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/[DEPT].[%DEP%],S_ACCOUNT=ACC_B)
*ENDWHEN
*NEXT
Yes I would like to perform it for all departments. We are using SAP Business Planning and Consolidation 11.0 Version for SAP BW/4HANA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of using REC, tried with
*BEGIN [S_ACCOUNT].[#ACC_B] =
([S_ACCOUNT].[ACC_A])/
([S_ACCOUNT].[ACC_A],[DEPT].CURRENTMEMBER.PARENT)
*END
*COMMIT
But this gives me MDX statement error:"Internal error : no result set"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In earlier example I have given plain department dimension. However need to have dynamically use the parent value in the calculation
ACC_A Expected Result in ACC_B
DEPALL 130
DEPA_PAR 40
DEPA_1 15 =15/40
DEPA_2 25 =25/40
DEPB_PAR 90
DEPB_1 40 =40/90
DEPB_2 50 =50/90
Where I need to pick the parent value dynamically as when current member for DEPT is DEPA_1 then automatically it should select it's parent value for division
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a ton for your immediate response. It did work for me when I put the actual parent name DEPTALL here. However I want to dynamically choose the immediate parent of Current member of the department. Is there any way with use of [DEPT].[CURRENT].Parent give that flexibility?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please read help: https://help.sap.com/viewer/ac22cb71e63345288987c4facb96861d/10.1/en-US/4c86c5f7707a6c4fe10000000a15...
"You cannot use other MDX keywords (such as PARENT and DESCENDANTS) in FACTOR or EXPRESSION instructions. The only permitted operations are addition (+), subtraction (-), multiplication (*), and division (/), combinations of these operators, and parenthesis for tuple and priorities of the operations."
May be you can use FOR/NEXT for parents, but the dimension structure and requirements are not clear!
Try:
*XDIM_MEMBERSET S_ACCOUNT= ACC_A
*XDIM_MEMBERSET DEPT=BAS(DEPALL)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/[DEPT].[DEPALL],S_ACCOUNT=ACC_B)
*ENDWHEN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
4 | |
3 | |
2 | |
2 | |
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.