on 2015 Jun 25 12:23 PM
Hi Experts,
using BPC 7.5 NW SP15, I have developed a script logic for calculating an EBITDA on material level.
In a first step, we copy the EBIT values to a statistical costelement (EBITDA TMP), then we calculate EBITDA TMP – Amortization = EBITDA.
The logic works fine in case we have values for all costelements (EBIT / EBITDA TMP, AMORT, DEPR) but if we have a material with no value for EBIT (as its children sum up to 0), the amortization values are ignored and EBITDA is empty. As this falsifies the EBITDA on company level, I want to get a calculation on material level which calculates (EBITDA TMP) 0 – Amortization = -EBITDA as well.
Any suggestion would be greatly appreciated.
Many thanks in advance!
Sabrina
This is my logic:
*SELECT(%LEGAL_SEL%,"[LEGAL_ENTITY]",ENTITY,"[ISPLANT]='D'")
*XDIM_MEMBERSET COSTELEMENT = BAS(CE_EBIT)
*XDIM_MEMBERSET ENTITY = BAS(E_ENT)
*XDIM_MEMBERSET PARTNERENTITY = BAS(I_ENT)
*XDIM_MEMBERSET MATERIAL = BAS(M_TOTAL)
*XDIM_ADDMEMBERSET COSTELEMENT = BAS(CE_STAT)
*FOR %ENTITY_ITER% = %LEGAL_SEL%
*WHEN ENTITY
*IS BAS(%ENTITY_ITER%)
*WHEN COSTELEMENT
*IS BAS(CE_EBIT)
*REC(EXPRESSION=%VALUE%,COSTELEMENT=EBITDA_TMP,PARTNERENTITY=I_NONE,ENTITY=%ENTITY_ITER%_DUMMY)
*ENDWHEN
*ENDWHEN
*NEXT
*COMMIT
-----------------------------------------------------------------------------------------------------------------------------
*SELECT(%ENTITY_SEL%,"[ID]",ENTITY,"[ISPLANT]='D'")
*XDIM_MEMBERSET COSTELEMENT=EBITDA_TMP
*XDIM_MEMBERSET ENTITY = %ENTITY_SEL%
*XDIM_MEMBERSET PARTNERENTITY = I_NONE
*XDIM_MEMBERSET MATERIAL = BAS(M_TOTAL)
*XDIM_ADDMEMBERSET COSTELEMENT = BAS(CE_AMORT)
*XDIM_ADDMEMBERSET COSTELEMENT = EBITDA
*WHEN COSTELEMENT
*IS EBITDA_TMP
*REC(EXPRESSION=%VALUE%-[COSTELEMENT].[AMORT]-[COSTELEMENT].[DEPR],COSTELEMENT=EBITDA,PARTNERENTITY=I_NONE)
*ENDWHEN
*COMMIT
Request clarification before answering.
Hi Sabrina,
The WHEN/ENDWHEN loop loops only existing records! If there is no record - no calculations.
Your second loop has to be done like:
*SELECT(%ENTITY_SEL%,"[ID]",ENTITY,"[ISPLANT]='D'")
*XDIM_MEMBERSET COSTELEMENT=EBITDA_TMP,AMORT,DEPR
*XDIM_MEMBERSET ENTITY = %ENTITY_SEL%
*XDIM_MEMBERSET PARTNERENTITY = I_NONE
*XDIM_MEMBERSET MATERIAL = BAS(M_TOTAL)
*XDIM_ADDMEMBERSET COSTELEMENT = BAS(CE_AMORT)
*XDIM_ADDMEMBERSET COSTELEMENT = EBITDA
*WHEN COSTELEMENT
*IS EBITDA_TMP
*REC(EXPRESSION=%VALUE%,COSTELEMENT=EBITDA)
*IS AMORT,DEPR
*REC(EXPRESSION=-%VALUE%,COSTELEMENT=EBITDA) //Negative %VALUE%!
*ENDWHEN
Due to WHEN/ENDWHEN accumulation the result will be correct.
And stop using absolutely useless COMMIT!
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 41 | |
| 9 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.