Trying to Flatten a Table

Hello Folks, new to Knime. I am trying to convert a single column into multiple columns at a certain data point. The data set looks something like this:

Column 1:
Identifier: 1245
Data 1: name
Data 2: address
Data 3: domicile
Identifier: 1246
Data 1: name
Data 2: address
Data 3: domicile
Data 4: employer
Identifier: 1249
Data 1: name
Data 2: address
Identifier: 1253
and so on…

I want to create columns so that:

Identifier | Data 1 | Data 2 | Data 3 | Data 4 | Data 5 |
1245 | name | address | domicile | | |
1246 | name | address | domicile | employer
and so on…

Therefore, the identifier is the key and I want to line up all the attributes listed after the identifier into separate columns.

Any help would be much appreciated.

Thanks!

Hi @smuhammad

This looks a lot like the question in this topic groupby-chunk-of-rows-unequally-distributed. I made some adjustments to my workflow to match your data. GroupBy chunk of rows unequally distributed 2.knwf (43.7 KB) . But you can also follow the suggestion/solution by @ipazin in this topic.
gr. Hans

3 Likes

Thanks @HansS. I will give this a try. Appreciate the quick response.

1 Like

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