How to take specific columns and create new rows, repeating contents of other columns

I have data output that comes out like this:

Column 1 Column 2 Column 3 Column 4 E F G H
Product Code Description Location 1 Code Location 1 Name Location 1 Volume Location 2 Code Location 2 Name Location 2 Volume
12345 Product A 8877 Ohio 200 6655 Kentucky 300
98765 Product B 2255 Indiana 100 6655 Kentucky 400

but I need the output to be like this:

Column 1 Column 2 Column 3 Column 4 E F
Product Code Description Location Code Location Name Location Volume
12345 Product A 8877 Ohio 200
12345 Product A 6655 Kentucky 300
98765 Product B 2255 Indiana 100
98765 Product B 6655 Kentucky 400

I feel like the Unpivot node is what I need but I cant seem to get the configuration correct - it’s adding way more rows than I’d expect. Any help is appreciated!

I’ve uploaded pictures of these sample tables in case it’s easier to read.


Hi @axlcox

Welcome to KNIME Forum

I found a possible solution…?,see concat_and_pivot.knwf (102.0 KB)

gr. Hans

1 Like