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:
rolling image 2

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 (202.7 KB)

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!

Rolling Iteration Task 2.knwf (48.4 KB)

Update:

It’s okay I think I’ve got it. A row-based route is faster to get there than the column route I posted last night.

4 Likes

Nice! Thanks for posting your solution :slight_smile:

1 Like