Using data from previous row in calculation with loop

Hi! I can’t find a way to calculate this yellow column in KNIME, the blue cells are a simple math formula but I don’t know how to tell KNIME to only do that math formula for the row with the earliest date for each product and the red cells depend on the value above them so I’m guessing it needs some sort of loop but again don’t know how to do it just for the dates after the earliest one for each product.

Does anyone know an easier way to do this? what I need is the weekly balance, starting with the initial stock.