This demonstration workflow provides a "template" for building a cumulative calculation using a recursive loop.
The aim here is that only the nodes marked by Orange Annotation boxes need to be changed for this to work with just about any non-basic cumulative calculation. (By non-basic cumulative calculation, I mean any cumulative calculation that requires more than the use of the "moving aggregation" node, and normally involves a multi-column mathematical calculation).
The initial Table Creator would obviously be replaced by your input data. This must contain ALL columns that will be included during processing, so this includes an initialised placeholder column for any value being calculated. e.g. If you are calculating "Cumulative Balance" in the rules/maths nodes later, you must make sure that the Cumulative Balance column already exists at the start of processing.
The Column filter is modified to specify the columns to be retained (carried forward) to the next row's processing.
The Rule Engine and Math Formula nodes represent the place where any calculations take place. Other nodes may be used here as well as, or instead of , the Rule Engine and Math Formula nodes. The PREVIOUS row's brought forward value of any column is found in the PREV#colname version of that column. All columns included in the Column Filter at (2) will have a PREV#colname column created.
Workflow
A template pattern for Cumulative Calculations using Standard Nodes with a Recursive Loop
Used extensions & nodes
Created with KNIME Analytics Platform version 5.2.0
- Go to item
- Go to item
- Go to item
- Go to item
- Go to item
- Go to item
Legal
By using or downloading the workflow, you agree to our terms and conditions.