Mapping Raw Excel Data into Template Based on Structure Mapping Table

I’m currently working on a workflow in KNIME and have encountered a challenge that I would greatly appreciate your advice and support with.

I have a structure where I need to generate a result Excel file by mapping data from multiple raw Excel files (Rawdata1, Rawdata2) into a predefined template. The mapping should follow a separate “Structure Mapping” table that specifies how each column from the raw data corresponds to the template fields, and which sheet they should go into.

To make it easier to understand, I’ve attached an image that outlines the structure visually.

  • There are 4 files: two raw data files, one structure mapping file, and one template.
  • Based on the “Structure Mapping” table, the data needs to be pulled from the raw files, columns renamed according to the mapping, and written to the appropriate sheet (TAB1, TAB2) in the result Excel file.
  • Each sheet in the result should mirror the layout of the template and be filled in with the correctly mapped data.

I’ve tried using loops and table row-to-variable nodes to dynamically handle sheet names and mappings, but I’m struggling to put the whole logic together, especially how to:

  1. Dynamically read the columns based on the mapping table.
  2. Match each set of columns to the correct sheet in the template.
  3. Write back to the correct sheet while preserving the template’s structure.

If anyone has encountered a similar problem or has a sample workflow, it would be a huge help.

I would be sincerely grateful for any guidance, example workflows, or tips to point me in the right direction.

Thank you in advance for your time and help!