cancel
Showing results for 
Search instead for 
Did you mean: 

How to change key figure value to 0 when key figure enters in past week

advait1998
Explorer
0 Kudos
365

I am working on 'Stock Projected' Key figure calculation.

My requirement is, this calculation should start from current week onwards. When we are seeing 'Stock Projected' key figure value in past weeks, it should be always 0.

(As I am using cumulative aggregation for this calculation, it should not consider previous week's value in aggregation for current week. The calculation should start from current week freshly.)

Using similar calculation in my case.

For example:

Period 1 is my current week.

Hence, calculation should start from current week freshly.

In my case now,

The period 1 'Stock Projected' KF calculation is using aggregation from last week's 'stock projected' KF value.

Therefore I need that value to get 0 in past weeks.

Please guide me to work on this case.

Accepted Solutions (0)

Answers (1)

Answers (1)

AyanBishnu
Active Contributor

Hello advait1998

Create a helper KF for doing the CAGGR calculation and use the 4th parameter as "CURRENTFUTURE". Then create a new KF (e.g ZPROJECTEDSTOCK) and use the below expression

ZPROJECTEDSTOCK@PL = IF("PERIODID" < "$$PERIODIDCU$$", 0, HELPERKF@PL)

advait1998
Explorer
0 Kudos

Hi Ayan, Thank you for your response. I will try this calculation suggested.

advait1998
Explorer
0 Kudos

Hi ayanbishnu1981, I have one small query.

In the above projected stock calculation in the screenshot, Instead of changing the key figure value to 0 for past time bucket, Can I modify the current calculation as follows:

Current calculation:

In the current calculation, If I changed the 4th Parameter as only 'CURRENTFUTURE', My Projected Stock in current week will ignore the Cumulative aggregation from Past time bucket?

It means for example, In the above screenshot, Period 1 is my current week.

Requirement is:

Stock Projected for current week should start from current week onwards to future. It should not consider the cumulative aggregation from last week's value. So if I change the present calculations parameter to only' CURRENTFUTURE'. It will solve my problem?

Please give me guidance on the same.

Thank you in advance.