Icon

Aggregation in Loop - Cumulative Sum - several approaches - KNIME Forum (82413)

<p>Aggregation in Loop - Cumulative Sum - several approaches - KNIME Forum (82413)</p><p></p><p></p><p></p>

Aggregation in Loop - Cumulative Sum - several approaches - KNIME Forum (82413)

https://forum.knime.com/t/aggregation-in-loop/82413/2?u=mlauber71

INNER Loop to aggregate the values according to the Expression Formula

if( $["Counter"]== 0,

$["Balance"],

if($$["currentIteration"] = $["Counter"]

, ($["Balance_New", -1]+($["SOH"]-$["Fcst"]))

, $["Balance_New"]

)

)

CSV Reader
Difference$SOH$- $Fcst$
Math Formula
Cumulative Sum for Grouping
Expression
Balance_New=>to later collectthe results
Constant Value Column
INNER START
Recursive Loop Start
Group by LAGcolumnOUTER START
Group Loop Start
$Counter$= $${IcurrentIteration}$$ => TRUE$Counter$ = $${Iiteration_before}$$ => TRUEcurrent and lastline
Rule-based Row Filter
remove the iteration variablesso as not to confuse thevariable from the inner loop
Variable Filter
Top: send backbottom: collect last iterationINNER END
Recursive Loop End
$Counter$ = $${IcurrentIteration}$$ => TRUE=> current line
Rule-based Row Filter
Concatenate
iteration_before
Java Edit Variable (simple)
Filter by Group Column("Lag" in this case)
Row Filter
exclude current iteration
Reference Row Filter
OUTER END
Loop End
determine the number of linesfor the recursive loop
Table Column to Variable
Counter Generation
Sorter
Extract Table Dimension

Nodes

Extensions

Links