Grouping multiple columns under one header

Hello!

I have set of data combined from three different tables with a common identifier on each table. Here I would like to differentiate the columns I picked from each table with a unique header at the top and their respective column names below.

Is there any specific way to get the above reference is done in knime without doing it manually in excel?

Regards,
Arigarane.

You’re more likely to get help if you share some sample data.

These are the base files. All these files have Position and owner name as an unique value. I want to combine them as a single file and have the file names as header as mentioned in the previous screenshot.

Quota.xlsx (10.0 KB)
MTS.xlsx (10.0 KB)
Comp plan.xlsx (10.1 KB)

@rfeigel - Any help with this would be really appreciated!!! Did you get a chance to look into it?

Sorry, I’ve been busy. Out of curiosity, why do you want to do this? This format will make to difficult, if not impossible to do any further processing/analysis of the table.

All the analysis will be done before this step. This will be final formatting before extracting this data in excel.

Hi @arigarane92
It is a litle tricky but it works with an excel template


TEMPLATE.XLSX (9.0 KB)

YOUR_FILE.XLSX (7.4 KB)
example_20250321.knwf (128.7 KB)
Br

4 Likes

Nice work @hmfa. I tried a workflow without the Excel template, but your approach is much better.

3 Likes

Hi,

I tried a different approach—although you may have already found your answer, I wanted to give it a shot.

First, the sheet names are fetched. Then, the corresponding Excel files are read, and a Constant Value Column is added with the sheet’s name. Finally, the sheet names are used in the pivoting step.

For your convenience, I’ve uploaded the KNIME workflow and a screenshot of the resulting table.

Hope this helps! Let me know if you have any questions.

Best,
Alpay

Grouping multiple columns under one header.knwf (43 KB)

4 Likes

@hmfa Thank you so much for the workflow. This works to my requirement :smiley:

I have one question on the use of Column Name Extractor node. What is the rational behind using this node here.

1 Like

@alpayzeybek - Thank you for looking this in a different approach. This works good as well.

1 Like

Hi @arigarane92
Sorry for the delay.
This is do fetch in separate the header as first row and next append the remaining table data.
Br
Hugo

1 Like

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