data set comparison

users
#1

How can we apply the following scenario:
data_set_1 has a key column and several columns. data_set_2 has an identical structure of data_set_1. We want to

  • what common keys among them.
  • what different keys among them in two direction. data_set_1 - data_set_2 and data_set_2 - data_set_1.
  • compare between each column in data_set_1 with its mirror in data_set_2.
0 Likes

Duplicate rows and matching columns
Compare content of multiple columns in pairs of two
#2

The first two points have been established.
The last one is remaining.

1 Like

#3

Hi there,

what should be the output of this (last point) comparison?

Br,
Ivan

1 Like

#4

something like that attached figure but over all the columns.

another thing, I want a node to compare columns which take two inputs.

0 Likes

#5

Hi there @ahmed_gomaa,

The best thing to me seems to use Column Expressions node. Prior to that you need to join your tables based on RowID to have all columns you want to compare in one table. Then in Column Expressions node create one rule like this for every two columns you want to compare and result will be true or false. Define your output column name in node dialog to differentiate column pair comparisons.

There is no node to compare columns from two different data sets.

One alternative could be to use Column Comparator node in loop with prior defined column pairs for comparison but his also requires joining data sets…

Br,
Ivan

3 Likes

#6

Thanks. It worked. It is very useful

1 Like

#7

how to apply that using Column Comparator in loop ?

0 Likes

#8

Actually, I want to make that automatically instead of specify the columns manually within the column expression node.

0 Likes

#9

Hi there,

In Column Expressions node you can also specify column by its index. So column(0) is addressing first column in your table. If you have a fix number of columns you can use that trick.

To use Column Comparator in a loop you can try something like this:

And here is workflow on KNIME Hub. It works if tables have same structures. Take a look and if any questions feel free to ask.

Br,
Ivan

2 Likes

#10

The number of columns may be changed. So, the comparison be something like this

For loop i = 0 to columns_number - 1

Column i == Column i (#1)
Hence, no need to specify the columns whether by name or by index.

0 Likes

#11

it works. many thanks.

1 Like

#12

Glad it helped.
Br,
Ivan

0 Likes