validate consecutive

hello community, I need to perform a validation of consecutive values in the same column, basically I have something like this:

ID test
1 -
2 1
3 1
4 1
5 1
7 2

where the ID is the number that should be consecutive, and the test is the formula result of substracting ID previous row… and so in a huge list I need to locate those “jumps” such in the last item where the difference is 2 and not 1.

do you have any idea of how can I add that formula? in excel is as easy as “=D2-D3” but cannot figure out an option here…

Hi @GQRanalytics,

I think a Lag Column node and Math formula will do the trick. See my example workflow validation of consecutive values.knwf (9.9 KB) . Also look at this post another Excel - related question with a tip from @ipazin for a a book From Excel to KNIME

gr
Hans

3 Likes

Hi there,

in addition to what @HansS provided this and similar calculations can be done using Moving Aggregation node. In your case Window type is Backward, window length is 2 and Aggregation method is Range.

Br,
Ivan

3 Likes

it worked just perfect, new node to the collection :):slight_smile:

1 Like

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