Icon

20200620 Pikairos Cumulative sum of consequent numbers in each group

Cumulative sum of consequent numbers in each group

I want to reach “result” column which depends on x,y and z columns. “result” column is constructed like that:

First,

x is the grouping variable
y is the sorting variable(ascending)
z is summing column

Then,
So for each goup(x), z is cumulative sum according to ascending y.

How can I do this using Knime.

DataGroup by xAggregate by z(cummulative)Preserve others as listDuplicate zfor later useCalled herez(cummulative)Ungroupthe list to recoverthe column valuesSum(z (cummulative)) -z (cummulative)Calculatecummulative valueof column zCalculatecummulative sumof z(cummulative)New column is calledSum(z (cummulative))$Sum(z)$ -$Sum(z (cummulative)) - z (cummulative)$Table Creator GroupBy Math Formula Ungroup Math Formula Moving Aggregation Moving Aggregation Math Formula InteractiveTable (local) DataGroup by xAggregate by z(cummulative)Preserve others as listDuplicate zfor later useCalled herez(cummulative)Ungroupthe list to recoverthe column valuesSum(z (cummulative)) -z (cummulative)Calculatecummulative valueof column zCalculatecummulative sumof z(cummulative)New column is calledSum(z (cummulative))$Sum(z)$ -$Sum(z (cummulative)) - z (cummulative)$Table Creator GroupBy Math Formula Ungroup Math Formula Moving Aggregation Moving Aggregation Math Formula InteractiveTable (local)

Nodes

Extensions

Links