Hello everyone,
I’m trying to write a workflow that compare the rows with the previous ones and as a result gives me an progressive index.
I’ll show you the example in this example in excel example.xlsx (11.4 KB)
I found the “rank” node (with “dense” ranking mode") that allow to create a progressive index, but for some cases the node don’t increase the index (See orange lines in the excel file).
How can I fix this problem?..or there is a better way to implement this workflow?
ok thank you, with this node I can shift datas from the preceding row; but I still don’t understand how to create the correct progressive index… I’m still tinking about comparing the acutal line with the preceding one and then increase the value.
Yes, comparing with the values of the previous row is what you have to do. I usually do this with Java Snippet, but it was fun to do it with “normal” nodes instead:
lag all comparison columns by 1 row
compare columns pairwise with lagged columns - if they’re all equal, put 0; otherwise 1
so whenever a new group starts, there’ll be a 1, following rows of the same group will have a 0
sum those increments cumulatively to get the “progressive index”. this is the excel equivalent of sum($A$1:A1) dragged down