table comparison

I would like to compare the columns of two tables one by one (column1 vs colum1(right), etc). I know, there is a node called Table difference finder, but I would like to do it a bit differently.
I created a loop where the relevant columns are filtered and the comparison made, but I cannot rid of the additional columns created during the iterations.
If there is a way to do that I would appreciate some help.
compare.knwf (35.0 KB)

Ok this is somewhat a weird one.

Column filter behavior when using flow variables is a bit awkward.

I did some tests and managed to get it work for the first iteration when I passed the exclusion columns (manually generated them for first iteration) as flow variables in addition to the inclusion columns - this worked!

I then copied the workflow and removed the inclusion columns keeping exclusion columns and this also worked!

I then took a closer look at your configuration of column filter BEFORE passing in the flow variable and noticed that the option “any unknown column” was in the “INCLUSION” box.

I removed the flow variable for inclusion in your initial workflow, moved “any unknown column” to EXCLUSION box, added back in the flow variable only with inclusion columns and voila - the workflow runs through.

tl:dr:
If you pass columns to include via flow variable, “any unknown column” must be in exclusion box

If you pass columns to exclude via flow variable, “any unknown column” must be in inclusion box.

So in your case it needed to look like this before configuring flow variable with inclusion columns:

image

Workflow: Green box on the right works - the other one’s are experiments for reference…

compareMD.knwf (198.5 KB)

I have to admit as awkward as this is I think it is an improvement from sometime in the last year - I recall that you needed to pass always both inclusion and exclusion columns to make it work with flow variables…

1 Like

thank you
Unfortunately the version I have to use doesn’t have the “Any unknown column” option, is something similar to enforce inclusion/exclusion?

Which version are you using? As I said this behavior may have changed in the last year or so…

In the old version of the node it should be similar to the enforce exclusion / inclusion radio buttons.

In general I think you’d have to check which one is currently checked and then simply use the other… assuming that the node behavior between 5.4.4 and the version you are using is the same.

It is the 4.5.1.
Many thanks for your help, it can proceed on this way.

Glad it worked out!

I’d appreciate if you can flag the post that solved the issue as solution so it gets tagget at the top for anyone searching for a similar issue in the future

2 Likes

Actually I think there was a misunderstood, probably due to my fault, I just realized it once I replied to your post.
I had two problems with the goal I wanted to achive:

  1. parametrize well the column filter-node with variable
  2. Setting up the loop on the right way.

So this is how I could manage to compare two tables with the same structure by looping through the columns. What I had to figure out myself, that loop end is not the thing I need, but better use the Loop end Column Appender node.
Seems to be obvious, but I had to spend some time into it.
Thanks a lot for your kind help.
table compare.knwf (38.5 KB)