cancel
Showing results for 
Search instead for 
Did you mean: 

Look Up Script Dump

former_member269849
Participant
0 Kudos

Hi Experts,

I 'm trying to calculate the value of a KPI wich is  (the value of currentday -Value of previous day )/2 , I added an attribute in my time dimension manually where I did the previous time, and  I use Look Up in the script but when I try to execute it , it's giving me a dump.

1-

*SAP_BW    740    0009    SAPKW74009    SAP Business Warehouse

*CPMBPC    801    0009    SAPK-80109INCPMBPC    CPM Business Planning and Consolidation

2- DUMP

3-I Have 2 dimensions  KPI_CDG and  Time dimension Temps. and the model is called Indi_Financiers

TIME:02015.01,2015.02,2015

KPI_Extraction :Capital....

4-Default.LGF

5 'm trying to calculate the value of a KPI wich is  (the value of currentday -Value of previous day )/2

6-this is the script i'm trying

*LOOKUP Indi_Financiers

*DIM PRV: TEMPS=TEMPS.PREV

*ENDLOOKUP

*WHEN  KPI_CDG

*IS KPI10406

*REC(EXPRESSION=(%VALUE%-LOOKUP(PRV))/2,KPI_CDG =KPI1021)

*ENDWHEN

*COMMIT

7- Data like 7800

8-

I can't do it .

thank you

Accepted Solutions (1)

Accepted Solutions (1)

former_member269849
Participant
0 Kudos

@Vadim : I read your document

and   I was forgetting *DIM MEASURES=PERIODIC

When I added it , it worked .

so thank you .

*LOOKUP Indi_Financiers

*DIM PRV: TEMPS=TEMPS.PREV

*DIM MEASURES=PERIODIC

*ENDLOOKUP

*XDIM_MEMBERSET MEASURES=PERIODIC

*WHEN  KPI_CDG

*IS KPI10406

*REC(EXPRESSION=(%VALUE%-LOOKUP(PRV))/2,KPI_CDG =KPI1021)

*ENDWHEN

*COMMIT

former_member186338
Active Contributor
0 Kudos

MEASURES setting in LOOKUP is required in default.lgf... I will add some comment to the mentioned document!

former_member186338
Active Contributor
0 Kudos

P.S. Have you tested what happen if you change both time and prev time simultaneously?

former_member269849
Participant
0 Kudos

Yes working correctly 😃 thank you Vadim

former_member186338
Active Contributor
0 Kudos

And what about next period value for KPI1021? It will be incorrect!

Sample:

You have already data in 2016.02, 2016.03 and 2016.04 for KPI10406 and result in KPI1021

You change value in KPI10406 for 2016.03 and the correct value will be saved in KPI1021 for 2016.03

But KPI1021 for 2016.04 will be incorrect!

P.S. Corrected - for 2016.04!!

former_member186338
Active Contributor
0 Kudos

is updated

former_member269849
Participant
0 Kudos

Vadim still giving me correct answer , should it be incorrect ?

former_member186338
Active Contributor
0 Kudos

You will have to add property NEXT:

*LOOKUP Indi_Financiers

*DIM PRV: TEMPS=TEMPS.PREV

*DIM NXT: TEMPS=TEMPS.NEXT

*DIM MEASURES=PERIODIC

*ENDLOOKUP

*XDIM_MEMBERSET MEASURES=PERIODIC

*WHEN  KPI_CDG

*IS KPI10406

*REC(EXPRESSION=(%VALUE%-LOOKUP(PRV))/2,KPI_CDG =KPI1021)

*ENDWHEN

*WHEN  KPI_CDG

*IS KPI10406

*REC(EXPRESSION=(LOOKUP(NXT)-%VALUE%)/2,KPI_CDG =KPI1021,TEMPS=TEMPS.NEXT)

*ENDWHEN

And don't use useless *COMMIT

former_member186338
Active Contributor
0 Kudos

In this sample just change value for 2016.02 from 20 to 30

2016.03 value for KPI1021 will remain the same and will be incorrect

former_member269849
Participant
0 Kudos

Yes absolutely right

former_member269849
Participant
0 Kudos

Thank you so much Vadim

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Time dimension screenshot with PREV property!

Have you filled all PREV for all base members?