Rolling Iteration

Greetings all!

I have a small task to do, which is to perform a rolling iteration (example here).

I’m looking for a low code solution.

Here’s how the input dataset looks like:

Here’s how I want it to (almost) end up with:

Basically, I have a specific lookback period, in this case 9. I want to list out all possible groups of dates available from the dataset for this lookback period of 9. Then out of those groups, I only select ones with the following criteria:

  1. Last row must be 7.

  2. Second last row must be 5.

Because I haven’t been using Knime for a while now, my skill is rusty, so I think I overkilled a simple task, here’s what I came up with:

Here’s the workflow:

Rolling Iteration Task.knwf

I hope to find an easier workaround to this task that doesn’t take up so many nodes like I did here, but still respecting a low-code approach, meaning no Java, Python or R snippets.

Thanks a bunch!