Adding values from 1 row as new columns on the next rows

I have a dataset which receives 3 different row types but at differing speeds , 1 type approx every 0.1 second, the other 2 every second

I want to add the columns of the other 2 types to all the consecutive rows until the value changes. (it would in fact be better if I could add it to the PREVIOUS rows but I assume this is much harder.). The idea is that I can get ALL the data into 1 row so I can analyse and compare them. If one is able to do it on the previous rows, the MAXIMUM number of rows it would need to change each time would be 20.

To picture the scenario

The 3 types can be distinguished by the ref column 182, 282 and 382

I want to add the 282 columns 1,2,3,4 to the 182 rows as columns 5,6,7,8 and the 382 columns to the 182 rows as columns 9,10,11 and 12.

I’m not worried about what is added to the 282 and 382 rows as once this has been done, I will delete these rows as they are no longer required.

Thanks

Hi,

I did the hard one! But easily :sweat_smile:

Here is the workflow:
column_append_to_previous_row.knwf (63.3 KB)

Feel free to ask your questions.

:blush:

2 Likes

Wow. Thank you very much.

Yes I can follow your logic and understand how you did it. Even though I would have never managed to work that out myself!

It also introduced me to the Table Row to Variable node and rule based Row splitter nodes which I had never come across before.

Thank you again.

Peter

2 Likes

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