Add cumulative sum until reaching a Threshold and flag such rows

Hi there @mauuuuu5,

if you are ok with scripting you can use following code in Column Expressions node to calculate cumulative sum with Threshold :wink:

var sum;
if(sum==null){sum=0;}

sum = sum + column("AMOUNT");

if(sum < 20000){
    sum;
}
   else{
sum=column("AMOUNT");
}

Br,
Ivan

4 Likes