Skip to Content
0
Former Member
Jun 25, 2015 at 11:23 AM

Scriptlogic doesn't work for empty values

30 Views

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