Subtracting Two Columns with Multiple Rows to Show a Decreasing Balance


I’ve researched the forum heavily and I cannot seem to find if this question was answered.

I have a table of entries per account that look similar to this, and would like KNIME to calculate each row and give me what’s left in “Hours Available”

Bill Period Hours Billed Hours Available
1 6 1994
2 4 1990
3 8 1982
4 4 1978
5 3 1975
6 3 1972
7 5 1967

I’m assuming I’ll need a Loop of some kind to facilitate it but I’m struggling to figure out what that would look like. Can anyone assist?

Thank you, and I look forward to your response.

Hi @jhandatx and welcome to KNIME Forum,

I’m not sure what your input dataset looks like. In this wf moving_aggregation.knwf (22.7 KB) I made a asumption, that there is only the bill-period and hours-billed in your dataset. But anyway the Moving Aggregration node can do the job for you.
gr. Hans


Greetings Hans,

Thank you very much for this information. The Moving Aggregation was the perfect solution to resolve this challenge.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.