Icon

Demo workflow for 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 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 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.


(2) Define rules and calculations. Use the PREV#colname columns inany rules or calcs requiring the previous row's brought forward value (1) Data In this demonstration, there are two projects A and B and each receives income and incurs costs.The specific aim is to calculate a cumulative sum for each project so that on each row, the current output valueshould be the cumulative balance brought forward + income - costs.But the primary aim of this workflow is to do this in such a way that it is reasonably generic.i.e. By modifying just the regions annotated in Orange, the calculation would work for a different set of data,with different column names. To achieve this, the non-orange nodes provide framework support for retainingthe "PREV#colname" columns which represent the value of a column retain on the previous row. 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 rowsperform calculationincludes useof previous row valuebrought forwardtop port calculated rowmiddle port - remaining rows for next iterationlower port - carried forward cumulative amountsnew project?reset the carried fwd to zero!Input 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 EndTable Creator RecursiveLoop Start Math Formula Recursive Loop End Rule Engine CumulativeFramework 1 CumulativeFramework 2 CumulativeFramework 3 (2) Define rules and calculations. Use the PREV#colname columns inany rules or calcs requiring the previous row's brought forward value (1) Data In this demonstration, there are two projects A and B and each receives income and incurs costs.The specific aim is to calculate a cumulative sum for each project so that on each row, the current output valueshould be the cumulative balance brought forward + income - costs.But the primary aim of this workflow is to do this in such a way that it is reasonably generic.i.e. By modifying just the regions annotated in Orange, the calculation would work for a different set of data,with different column names. To achieve this, the non-orange nodes provide framework support for retainingthe "PREV#colname" columns which represent the value of a column retain on the previous row. 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 rowsperform calculationincludes useof previous row valuebrought forwardtop port calculated rowmiddle port - remaining rows for next iterationlower port - carried forward cumulative amountsnew project?reset the carried fwd to zero!Input 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 EndTable Creator RecursiveLoop Start Math Formula Recursive Loop End Rule Engine CumulativeFramework 1 CumulativeFramework 2 CumulativeFramework 3

Nodes

Extensions

Links