Icon

Calculating Tree from levels with Cumulative Framework Components

Cumulative Framework Demonstration

This demonstration workflow provides a "template" for building a cumulative calculation using a recursive loop with my Cumulative Framework Components

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, or subsequent nodes (prior to the Cumulative Framework 1 component must contain ALL columns that will be included during processing where the previous value is important in the calculation, 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 Rule Engine and other nodes in the Orange annotations represent the place where any calculations take place. Other nodes may be used here as well as, or instead of , the Rule Engine etc.

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 input to Cumulative Framework 1 will have a PREV#colname column created.

(2) Define rules and calculations. Use the PREV#colname columns in any rules or calcs requiring the previous row's brought forward value (1) Data In this demonstration, each row contains the "tree level" for which a "tree" is to be calculatedso the resultant tree will take the form11.11.1.11.1.21.21.2.11.2.222.12.1.1and so on according to the supplied levels This is the table being calculated. It must contain a "placeholder" for any newcolumn that is to be calculated. i.e the column must be present hereiterate rowstop port calculated rowmiddle port - remaining rows for next iterationlower port - carried forward cumulative amountsdetermines what the"previous" row should be treated as,if not presentInput port: Input data tableOutput:top port: top input of 2x2 port recursive loop startlower port: lower input of 2x2 port recursive loop start Input:from 2 port Recursive Loop StartOutput:UPPER: to Cumulative Framework 3LOWERLOWER:: to RULES AND CALCSInput:UPPER: from Cumulative Framework 2LOWER: from RULES/CALCSOutput:to 3 port Recursive Loop End"Tree"output columnGet final numericGet new tree for rowGet Tree to current leveluses regex to return string up to the required"level" numberGet Tree to parent leveldetermine if new levelneeds to be appendedremove columnsnot required Table Creator RecursiveLoop Start Recursive Loop End Rule Engine CumulativeFramework 1 CumulativeFramework 2 CumulativeFramework 3 ConstantValue Column String Manipulation String Manipulation String Manipulation String Manipulation String Manipulation Column Filter (2) Define rules and calculations. Use the PREV#colname columns in any rules or calcs requiring the previous row's brought forward value (1) Data In this demonstration, each row contains the "tree level" for which a "tree" is to be calculatedso the resultant tree will take the form11.11.1.11.1.21.21.2.11.2.222.12.1.1and so on according to the supplied levels This is the table being calculated. It must contain a "placeholder" for any newcolumn that is to be calculated. i.e the column must be present hereiterate rowstop port calculated rowmiddle port - remaining rows for next iterationlower port - carried forward cumulative amountsdetermines what the"previous" row should be treated as,if not presentInput port: Input data tableOutput:top port: top input of 2x2 port recursive loop startlower port: lower input of 2x2 port recursive loop start Input:from 2 port Recursive Loop StartOutput:UPPER: to Cumulative Framework 3LOWERLOWER:: to RULES AND CALCSInput:UPPER: from Cumulative Framework 2LOWER: from RULES/CALCSOutput:to 3 port Recursive Loop End"Tree"output columnGet final numericGet new tree for rowGet Tree to current leveluses regex to return string up to the required"level" numberGet Tree to parent leveldetermine if new levelneeds to be appendedremove columnsnot required Table Creator RecursiveLoop Start Recursive Loop End Rule Engine CumulativeFramework 1 CumulativeFramework 2 CumulativeFramework 3 ConstantValue Column String Manipulation String Manipulation String Manipulation String Manipulation String Manipulation Column Filter

Nodes

Extensions

Links