Creating a column with the cumulative sum of values in another column. Possible without scripting?

Is there a node that allows computing the cumulative sum of another column up until each row? For instance if the source column contains the values 1,2,0,7,3,… the resulting column would contain the values 1,3,3,10,13,…
I think some solutions are suggested in this topic, which all rely on scripting. It is also suggested that KNIME 2.10 would present an easier solution. We are now at 4.4. Has this been realized?

Thanks in advance for suggestions,
Wilfred

2 Likes

Hello @wvdvegte,

and welcome to KNIME Community!

Yes there is node to compute cumulative sum:

In case you do it on a group level check this topic:

Br,
Ivan

5 Likes

@ipazin, thanks a lot - it works! I expected Moving Aggregation would only do this for a limited window length, but it turns out that if you check “cumulative computation”, the “window length” is nicely greyed out:)

1 Like

Actually I think the name “moving aggregation” is a bit confusing here, since there’s no moving window - but yes, in a way, the aggregation is moving from each row to the next

Hi @wvdvegte , that’s exactly correct, the “moving” aggregation refers to the fact that it is moving from each row to the next, and that the value is “moving” (changing). It’s essentially cumulative.

1 Like

Wait until you try the string to datetime formatting options. They are the real “confusing” fun in this forum
:sweat_smile:
br

3 Likes

Actually, I struggled a bit with string to datetime but could sort it out without having to resort to the forum.

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