Deleting rows depending values of previous row

Hello,
I am not new at Knime but stuck with a problem, which normally is easy to fix.

I have table with two columns sorted by Date

DATETIME                  | Value
2020-12-31T10:00:15 | 6
2020-12-31T10:00:30 | 6
2020-12-31T10:00:45 | 6
2020-12-31T10:01:00 | 7
2020-12-31T10:01:15 | 7
2020-12-31T10:01:30 | 6
2020-12-31T10:01:45 | 7

Now i want only keep the changed values rows like this example:

DATETIME                  | Value
2020-12-31T10:00:15 | 6
2020-12-31T10:01:00 | 7
2020-12-31T10:01:30 | 6
2020-12-31T10:01:45 | 7

Did anyone has an Hint for me?

Thanks a lot!
Marcus

hi @MarcusG and Welcome to the KNIME forum,

first you need a Lag column node…

choose the “Value”-column and Lag=1, Lag Interval=1.
Then you have the previous value appended as another column.
With the help of the rule-based row filter…

you may delete the rows where the two Value columns are equal.

Hope that helps, greetz, Tommy

6 Likes

Wow, this was easy.
I didn’t recognize the “Lag Column” Node. This helps and works!!

Thanks a lot!

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.