Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
valpassos
Creator III
Creator III

Restart calculation in script

Hi community,

Attempting a new way to formulate my problem. I'm on it for a few weeks now...

I'm trying to achieve the following data structure in my script:

valpassos_1-1619541810475.png

 

I want to calculate #Days Exhausted by Customer and Report Date. The logic to get to this number is already set up and it's correct: I'm recursively subtracting my Sales amount from my Debt amount, month by month (backwards) until the difference is negative. By each complete month I'm adding the days of that sales month. I'm doing this based on sorted tables and using the peek() function.

But I need to aggregate this calculation against all my Report dates, and right now I'm only able to set up the calculation against my most recent Report Date (which is 28/02/2021). I'm getting zeros in the red part of the screenshot.

What I'm saying is: I'm only getting the blue part of the picture above, and I need the red one as well (I have multiple report dates). How am I supposed to restart the #Days Exhausted calculation against all my Report Dates?

In an aggregated way, what I need is this:

valpassos_2-1619541920642.png

Thank you in advance!

Regards,

Lisa

1 Reply
valpassos
Creator III
Creator III
Author

I'm bumping the question because it has been edited a lot.