[loop help] sum numbers till meet target

I want to sum the numbers till it meet a target like 500. => iteration 1
then start a new round of calculation till hit target again and till the loop end.
I tired a stupid way using moving aggregation with “window 2” .Then filter out the result that is off sum up target and aggregate with “window 3” … … …
Should I use the Variable Condition Loop in this case? I tried but failed… :smiling_face_with_tear:
Please help me :rose: :sunflower:

Hi @zerobserver,

I tried creating a possible solution following your definition but am not quite certain about the results. To double verify what should happen can you please check the following if that meets what you have in miind?

  1. Check if value of current cell >= threshold 500
  2. If true write result to column “Result”
  3. If false / threshold is not met, calculate “temp-result” by sum of current + next cell
  4. Check if temp-result >= threshold 500
  5. If true, write result to column “Result”
  6. If false / threshold is not met, continue until condition is met / end of column