This forward looking type of operation is typically best performed using either time series nodes or the Python/R scripting integrations which allow you to load the whole table at once. If you are allergic to scripting or just want to try in native knime first, I would start with the Window Loop Start node.
It is became a challenge!
In my opinion it is impossible that there is not a way to refers to the previous/next cell, already modified, in a table.
I’m new of KNIME (previously I used to use matlab for everithing), and I think that I have not understood its real spirit, yet.
Now I’m using the Window Loop Node (as you’ve suggested) to select the sigle row, with a Case SWITCH Data Node controlled by the column1 variable.
If the control number is 1, I put 0 in the appended column; in the case of 0 the counter append a new column, that ise always the min value of the counter… it is frustrating!
Here’s one way you could do it, without a loop. This workflow uses the Moving Aggregation node to look forward in the data, and then does some manipulation on the results to determine what the final values should be. I’ve left the interim steps as individual columns in the table so the logic is a bit clearer.
The downside is that this workflow is hardcoded to look ahead 5 observations. It’s easy enough to change that in the Moving Aggregation node, but still, it’s something to be aware of. As usual with most workflows, there is probably a more elegant way to do this, but hopefully this is enough to get you started.
Hi Scott, thanks for your reply.
Your workflow was very useful and helpful for my purpose. You also make me discover the ‘aggregation power’
I’d like to purpose a different solution that, in my opinion, is easier and more intuitive than yours. Maybe I can help someone. I’m newbie of KNIME, so correct me if I’m wrong!
In my workflow was also useful the normal count, so I attach also this solution in the following.