Hi @Mo_Gha
I’m assuming the problem you are facing is that if you split the table into two, with the two sets of columns, when you try to concatenate the tables the rows don’t “stack” nicely, because you have different column names. It is a pity that the concatenate function doesn’t have an option to simply take the column names from the first table, and then concatenate by column position rather than name, which is what you are wanting to do here.
Your problem therefore involves an additional step. Firstly as @Daniel_Weikert has mentioned, you can use the Column Splitter or Column Filter. As both your resultant tables require one column in common, (ROW ID), I would in this case use two Column Filters. Both of these join to the original input data. You can use regex patterns to filter your columns.
One filter pattern would take the ROW ID and “General” columns
.(Row ID|General).
The other filter pattern would take the ROW ID and “Granularity” columns
.(Row ID|Granularity).
The next step, which is to rename the columns of the “Granularity” table to match the columns of the “General” table, so that it can be concatenated.
My method for doing this is as in the following image. Hopefully the comments in the diagram go some way to explaining how this works, but the net result of this (at the output of the “Insert Column Header” node is that the “Granularity” table now contains the column names from the “General” table.
Finally the tables can be concatenated:
It so happens that I have a component on the KNIME Hub that does the table renaming (using the above method). It was actually written to rename the default columns name from a “Table Creator” component, so it’s name is not obvious (may I should change that!).
The component is available here
Attached is a demo workflow containing both the “full” method, and the one using the component.
Split Columns and Concatenate Tables.knwf (50.5 KB)
If your table columns are subject to change, you’d need to adjust the regex pattern. Maybe you could use flow variables if this needs to be made more generic, but hopefully it gives some ideas and assistance.