Pairwise aggregated rows with different columns

Hey all, our system generates mixed data and downloads it in a file that looks like this:
Bildschirmfoto 2023-10-19 um 18.01.39

Basically it is a pairwise dataset with some identical columns, some missing columns and some “new” columns. My job is to sort this pairwise data set and aggregate the same data into the appropriate columns. So the output should look like this:
Bildschirmfoto 2023-10-19 um 18.08.46

I am afraid that will result in a complicated workflow with loops and splitters, but your help is highly appreciated, because I am quite new to KNIME:-)

You always have 2 rows?
You could first get rid of the original header row. You split your first 2 entries from the rest with row splitter. You use Row to column names node to make your first row as the header. For the second split you now use chunk loop with size of 2 and use row to column names to generate the names. Then you use concatenate (with intersection of columns) to add the loop iteration to the split you created first when splitting your data.
There might be better options but that’s sth I could think of to give you some guidance.
br

3 Likes

Hi @ochaas

See this wf pairwise_aggregated_rows.knwf (36.2 KB). It is more or less the approach as suggested by @Daniel_Weikert .


gr, Hans

3 Likes

Hi Daniel, thanks for the input - didn’t try it yet but my head says that this will work. You saved my day/week!
BR Christian

Hi Hans, thanks so much for building this wf as an illustration! That helps me a lot,
Best regards, Christian

1 Like

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