Moving Aggregation until a specific value is reached

Hi,

I have to calculate the cumulative sum of a column until a specific value is reached.
Example:
image

In this example, the cumulative sum of column “Amount” has to be calculated for each group of “Invoice” until the cumulative sum is equal to the “Threshold Amount” of that Invoice. When I am using Moving aggregation node, I’m getting value as in the “Cumulative Sum” column, whereas the expected output is the “Expected Cumulative Sum” column.

Is there a way to accomplish this?

Thank you

I could only think of some additional steps like
rule engine (if cumsum = 0) => Blank, Then missing value fill with previous value to fill the blanks and for the other missing values you could fill them with cumsum value
br

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.