Skip to Content
1
Jan 12, 2023 at 07:32 PM

SAP IBP reference previous month value in current month calculation.

435 Views Last edit Jan 13, 2023 at 02:48 PM 5 rev

Hello,

I have a requirement from our business to create a new key figure (KF1 for example) that has two conditions.

1. If my current period PERIODID3=$$PERIODID3CU$$", then have KF1 = KF2+KF3+KF4+K5-KF6-KF7

2. Else if period > than current period, MAX(KF1(t-1),0) +KF4 +KF5 -KF6 -KF7

We are not concerned with past data for this purpose, only current month moving forward. The issue I keep having is trying to reference to the previous month; I continue to receive chain errors since the key figure input references the same key figure. I attempted to create a helper key figure ZHKF1 = IBP_PERIODSHIFT(KF1,1) but still get the same error. All key figures are at the same planning level. (i.e MTHPRODLOC).

Thank you for any input!

EDIT Updated Pseudo code:

1. If current period PERIODID3=$$PERIODID3CU$$", then have KF1 = KF2+KF3+KF4+K5-KF6-KF7

for the following months, PERIODID3 > $$PERIODID3CU$$, then have MAX(KF1(t-1),0) +KF4 +KF5 -KF6 -KF7