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.
@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:
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.
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.
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).