Help on Rolling Calculations by week

I don’t know what nodes to add to me workflow for the below calculation.
do other users have a possible solution?

to my workflow i want to add a rolling calculation that take 2 values from another using the result of the previous result as the starting point.

As below for week 21 (first week of analysis) I want to take the stock minus the qty of demand plus the qty of supply
for week 22 i want to use the result from week 21 and then minus the qty of demand and plus the supply.

attached snippets of easily done in Excel but i want replicate in KNIME

Hi @134 , have you tried these (after uploading the table to KNIME)?

  1. Convert the table values to numbers using the String to Number node
  2. Calculate using the Math Formula (Multi Column) node.

I think it’s really that easy.

If you need only Week 21 and 22, use the row filter.

EDIT: Sorry, my mistake. Didn’t notice you wanted to operate between different rows. A Lag Column node might need to be used to append additional columns with values from previous row.

If possible upload the sample data. Where is the start value comming from?

attached is my current data set, the stock data is coming from an MRP system, thanks
Demand Vs Supply - Current State.xlsx (396.6 KB)

I would probably go with a helper (calculating the deltas demand - supply and add a starting value at counter index 0) and then use the running total (moving aggregation node)