Previous/Next Value

I am struggling with a kind of "search and find" type of problem. Is there any way to find out the "previous" and "next" different value of a certain value via native Knime nodes?

For example, in a column like the one below, if I wish to find out the previous and next different value of 56, which nodes might be of help?

Column 1










Hi boraster,

what about a simple Row Filter to extract the rows that are below 56? Then, you can either use a GroupBy without grouping column and "Maximum" as aggregation column or a Sorter and another Row Filter to extract the first / last row of the table. The same approach can be applied to extract the next value.

Hope this helps,


You can also use GroupBy first, grouping on this column so your numbers are unique, and then use the Lag Column node which will put the next value into a new column for you.


Hi Simon,

If I use the Lag Column, then I get the previous value of the selected row, but how can I get the next value of the same row via Lag Column? Can you please elaborate on that a little bit more?


Reverse the data and apply a second lag column ?

Thanks a lot.

Reversing does the trick!!!!!