Skip to Content
0
May 22 at 01:20 PM

Script Logic *REC with differents periods

102 Views

Hi everyone,

I'am trying to do a script logic in SAP BPC 10.1 Standard with next parameters:

The target is for example, when the user select the month ABR.2021, I should have a package for the next;

EBITDA_MOVIL= VALUE EBITDA(DIC Previous year - VALUE EBITDA(ABR Previous year - VALUE EBITDA current year)

I made the next script, but i have a problem with the lookup;

//**********Calculo Ebitda Movil***********//

*SELECT(%ANIO%,YEAR, TIEMPO, ID = %TIEMPO_SET%)

*SELECT(%MESES%,ID, TIEMPO, ID <= %TIEMPO_SET% AND ID >= %ANIO%.01)

*XDIM_MEMBERSET FLUJO=F99

*XDIM_MEMBERSET AUDITORIA=BAS(ALL_AUDIT)

*XDIM_MEMBERSET INTERCOMPANY=BAS(TOTAL)

*XDIM_MEMBERSET GRUPO=BAS(TOT_GRUPOS)

*XDIM_MEMBERSET MONEDA=USD

*XDIM_MEMBERSET VERSIONES=%VERSIONES_SET%

*XDIM_MEMBERSET TIEMPO=%MESES%

*XDIM_MEMBERSET SOCIEDAD=%SOCIEDAD_SET%

*XDIM_MEMBERSET CUENTA=EBITDA

*LOOKUP CONSOLIDACION

*DIM T0:TIEMPO =TMVL(0,%TIEMPO_SET%)

*DIM T1:TIEMPO =TMVL(-1,%TIEMPO_SET%)

*DIM T2:TIEMPO =TMVL(-2,%TIEMPO_SET%)

*DIM T3:TIEMPO =TMVL(-3,%TIEMPO_SET%)

*DIM T4:TIEMPO =TMVL(-4,%TIEMPO_SET%)

*DIM T5:TIEMPO =TMVL(-5,%TIEMPO_SET%)

*DIM T6:TIEMPO =TMVL(-6,%TIEMPO_SET%)

*DIM T7:TIEMPO =TMVL(-7,%TIEMPO_SET%)

*DIM T8:TIEMPO =TMVL(-8,%TIEMPO_SET%)

*DIM T9:TIEMPO =TMVL(-9,%TIEMPO_SET%)

*DIM T10:TIEMPO =TMVL(-10,%TIEMPO_SET%)

*DIM T11:TIEMPO =TMVL(-11,%TIEMPO_SET%)

*DIM T12:TIEMPO =TMVL(-12,%TIEMPO_SET%)

*DIM MEASURES=PERIODIC

*DIM T0M:TIEMPO =TMVL(0,%TIEMPO_SET%)

*ENDLOOKUP

*WHEN CUENTA

*IS EBITDA

*WHEN TIEMPO.MONTHNUM

*IS 1

*REC(EXPRESSION=LOOKUP(T1)+(LOOKUP(T12)*-1)+LOOKUP(T0M),CUENTA=EBITDA_MOVIL)

*ENDWHEN

*ENDWHEN

*COMMIT

*WHEN CUENTA

*IS EBITDA

*WHEN TIEMPO.MONTHNUM

*IS 2

*REC(EXPRESSION=LOOKUP(T2)+(LOOKUP(T12)*-1)+LOOKUP(T0M),CUENTA=EBITDA_MOVIL)

*ENDWHEN

*ENDWHEN

*COMMIT

I did it just to test the first two months. Since this should work for twelve months, but depending on the month of selection. How can I make it dynamic and work?

I hope I have been clear with what I need. Thanks for your time and help

Attachments

yp06p.png (36.3 kB)
z88tr.png (162.4 kB)