The easiest way is probably a Java snippet, if you know how to write java code.
maybe also define your problem in a more general way. To be it sounds like you want to do some aggregation or cumulative sum? Have a look at MovingAggregation node.
Hi @SahandMalek,
if I’m on the right way your Column C in your table contains the observation. But then your formula in Column D does not consider the observation change.
With Knime you should get the solution if you take your Moving aggregation Node between a Group Loop Start Node and a Loop end Node using your identifier and observation as group criteria.