Mulitple rows with unique ID combining in one row

Hi there,

I’m new to KNIME and struggle probably with an easy to solve problem. Although I have not seen any query with this problem.

I have two input tables with various rows all having the same unique ID but different content. I would like to have one row per ID combining all data sets either in one column (output #1) or on mulitple ones (output #2).

Example: I have two tables that contain identical unique ID’s but different content. I want merge them into one row with all combined content.


It’ll be great if some of you could point me to a solution.

Many thanks in advance

@knickmanns Welcome to the forum!
I don´t know if this is the simplest way to do it.
Create a table like this:
and then use the pivoting node. This gives:

pivot node.knwf (18.9 KB)

1 Like

What @iperez suggested here is what I was thinking of.

Also, for the second operation to generate a comma separated string, take the pivoted values generated above, clean them up a bit, and use the Column Combiner node. Or alternatively, implement the Create Collection Column node if you prefer a collection.

1 Like

concatenate and group by nodes should also work

1 Like

Hi Daniel,

I tried your proposal but did not make it work.

How can the groupby node write the “value” column parameters from different rows in one column or separate ones?
With concatenate and groupby it looks like this.


Aim is to have it like:
|DO0001|LA1, LA2, LA3, …GU1, GU2, GU3|

Many thanks in advance

Many thanks for you help and the pivot node. Still I can’t make it work. I haven’t found out what the auxilar shall do.

The pivot node requieres at least three different variables to work: One for creating the groups (rows=id), one for the columns (here is where you use the auxiliar column, one for each value) and one to do the aggregation (in this case your “value” attribute).

In the second tab of the groupby node you should be able to specify the aggregation type

Hi Daniel,

it finally worked. Many thanks. The groupby node also offers the perfect filter to unique entries.


Great thanks for your update.

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