Check column values vertically

Hi All,

I have a table, where I need to mark the lines where the column value equals the value in the same column but one row above.
I mean something like this:

1|A|1|
2|A|0|
3|B|1|
4|B|0|
5|B|0|
6|C|1|
7|C|0|
8|D|1|
9|D|0|

I tried the lag node, but it is not exactly I am looking for ( or maybe I coulnd’t use it properly)
I would be grateful for some help

Thanks

Take a look at the Moving Aggregation node. You may have to apply the rule engine node or column expression node afterwards with an if statement to get the exact format of your “marker” column afterwards.

Thanks, but could you be a bit more specific? I tried this node as well, but couldn’t succeed.

1 Like

KNIME_project3.knwf (12.9 KB)

In the attached workflow, I used the Unique Count Aggregation in the Moving Aggregation node followed by an if statement in the Column Expression node.

1 Like

Many thanks for your help.

1 Like

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