At the moment the "GroupBy" node and its similar do not offer a cumualtive sum aggregation method (for now). We need to recur to a "Java Snippet" node.
Even though people do not usually like to use the "Java Snippet" nodes, the code required to perform a cumulative sum is really minimal.
- Let's use a "Java Snippet (simple)" node which is simpler to configurate
- Now let's define a global java variable in the upper part of the configuration window, that is in the frame named "Global Variable Declaration", like for example: double sum = 0.0; This means that we create a variable named "sum" of type double and initial value 0.0.
- Let's add the following code in the frame named "Method Body":
Here at each row we add the current value of the selected data column to the java variable "sum" and we return "sum"'s value for the current row.
Moving to the next rows, "sum" is not reset because it is declared in the global java variable space and keep adding data column values row by row, that is the cumulative sums.
The only thing missing in the previous piece of code is <data column>.
Double-clicking a column in the "Column List" panel in the upper left corner automatically inserts the data column value in the java code ready to be used. So, select the wording "<data-column>" in the code and double-click the column values you would actually like to se from the "Column List" panel.
Below is an example of a "Java Snippet (simple)" node implementing cumulative sums.