Column Expressions Loop

Hi

I am trying to loop through columns (in two joined tables) and compare the data in each column in the column expressions node.

I have extracted the column headers from the two joined files as follows:

I have then used these to create variables via a table row to variable loop start node:

My column expression is as follows:

I have connected the column expressions node to a loop end node but get the following error message on iteration 1:

Execute failed: Input table’s structure differs from reference (first iteration) table: Column 66 [Tax Reporting Unit (#1) (String)] vs. [Payroll Statutory Unit (#1) (String)]

As far as I can see the variables are correct:

Where am I going wrong?

Thanks
Chris

Hi You probably want to show your whole flow for better debugging.

Loop end nodes can be configured to allow changing table specs
but I would also ask why you need a loop to check whether columns in 2 tables are same or not?
br

3 Likes

Hi @Daniel_Weikert

Here is my workflow:

There are 33 columns in each table so I didn’t want to have to write a column expression to compare each column so I thought I would try to use a loop.

Is there a more efficient way?

If it’s about the col headers then some kind of unpivoting/ table transposing and then do a rule engine would be a way.
And there is also a table difference finder node for exact comparison of content as well
br

I need to compare each row of data in each column in table 1 with the corresponding column in table 2 (with a (right) suffix). For example, from the top joiner port I need to compare:

Payroll Statutory Unit - Payroll Statutory Unit (right)
Tax Reporting Unit - Tax Reporting Unit (right)
Calculation Breakdown - Calculation Breakdown (right)

…and so on for all 33 columns in each table.

1 Like

Hi @Daniel_Weikert

I have solved my problem. I tweaked the workflow slightly. Changed the loop end to a loop end (column append), filtered out the original data and then used a Joiner node following loop end to join the result with the original input data.

3 Likes

Hello @fostc80857,

don’t know if you are aware of Table Difference Finder node. That’s the node that compares two tables. Maybe it can be useful in your case and help you simplify your workflow.

Br,
Ivan

3 Likes

Hi @ipazin

Thanks for the heads up on the table difference finder node.

I did give that a try but I find its output difficult to read. I am also not sure it would work in this instance as my source data tables don’t have the same number of records (hence why I have used a joiner node to identify records in one table and not the other (and vice versa).

In addition, the end user has requested a format which allows them to look at and filter on each comparison column.

1 Like

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