Icon

Cumulative Framework solution to looping calculations

Workflow using "Cumulative Framework" components to solve a cumulative calculation problem.

The aim is to compare an amount against a given "name", with values for each month, and determine which month values will form part of the total amount value.
The original problem is detailed on the KNIME forum at the link attached

@takbb Brian Bates

RULES AND CALCULATIONS
CREATE COLUMNS TO STORE CALCULATED VALUES
create "RemainingAmount"column
Constant Value Column
Unpivot
input
Table Creator
decide if we should collect this month name(if previousremaining amount> 0AND amount for this month > 0)
Rule Engine
create "Months"column to collect monthsin
Constant Value Column
Recursive Loop End
Input: UPPER: from Cumulative Framework 2 LOWER: from RULES/CALCS Output: to 3 port Recursive Loop End
Cumulative Framework 3
Recursive Loop Start
Input port: Input data table Output: top port: top input of 2x2 port recursive loop start lower port: lower input of 2x2 port recursive loop start
Cumulative Framework 1
concatenate the months and return final "amounts"after calculations
GroupBy
Input: from 2 port Recursive Loop Start Output: UPPER: to Cumulative Framework 3 LOWER:: to RULES AND CALCS
Cumulative Framework 2
include inoriginal table
Value Lookup
if name changesreset the "previous remaining amount" to be current amount
Rule Engine
carry forwardnew remaining amount
Math Formula

Nodes

Extensions

Links