Loop merging problem

Hello, I want to read excel tables in batches and use loop to merge the tables of all files into one table. The process is as follows, but the following message appears:

ERROR Loop End 4:20 Execute failed: Input table’s structure differs from reference (first iteration) table: Column 9 [初期壓差(COA) (String)] vs. [過濾循環PUMP壓力 (String)]

It looks like the sheets your are iterating over have different column names (in your case column 9 differs between the first sheet that was read and the one where it fails as the error suggests).

It depends on your use case and set up - if the column naming is not relevant and the data in column 9 is definitely always what should be in column 9 you can modify the settings of the excel reader so that it just names the columns A, B, C etc. instead of using what is in the first row.

You can do this by configuring the Excel Reader => Data Area Tab and uncheck the box under Column Names as shown below.

image

You can then use Column Renamer to assign names as you need after reading in the data.

If the naming is relevant than this means there is an Excel file that is not compatible in terms of its structure of what you are trying to achieve. To give advice on that some example data (anonymised) would be very helpful to better understand what it is you are trying to achieve.

1 Like

Hi @lca50666, as an alternative, you can change the config for the Loop End node to allow “changing table specification”. This will then give you the “union” of the different columns.

image

As @MartinDDDD said, it really depends on what you are expecting/wanting to occur where the sheets have different columns.

There are a variety of ways to deal with differing column names, so if you can give further information on what you are wanting to happen, we can possibly suggest other approaches.

4 Likes

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