Or a “negative lag” to look down Cod2 in order to test if it falls sequentially so that it can be moved to a new column.
This negative lag style approach may also now be possible just using the Column Expression node with the recent addition of multi-row support, but I haven’t had time to delve into it yet…
I guess you could also loop through rows in one Cod1, append it to a “transformed” Cod2, test for when the columns fail to fall in sequential order, then delete the remaining columns, then concatenate your row results into a table at loop end. Slower processing, but it should work as an alternate option.
I wasn’t thinking about it along the lines of Parent / Child relationship without the context in the sample data. Great approach @bruno29a! I am going to incorporate this into projects as well!