Relative cell math calculations

Hi all , 


i'm very new to knime and i need your help. i want to perform relative cell math calculation within Knime like the below example :


Orders Inventory remaining 
100 5000 (Opening Stocks)

and the desired output is like below


Orders Inventory remaining 
100 5000 (Opening Stocks)
50 4900
20 4850
30 4830


any clue how i do this in knime ? 

The fast raw solution:

1. Read Inventory remaining in the variable.

2. Use Moving Aggregation node to add moving sum column.

3. Use Math Formula node to subtract moving sum from remaining value (adding column).

4. Filter 2 necessary columns.

1 Like

Thank you, 

but i didn't understand how to read inventory in the variable, what node should i use for this,


if you can provide workflow i would be very grateful 

Say Tatble Column to variable or Table Row to Variable node. Also, you need to read your data to KNIME from the source (DB, Excel, so on).