Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pgarcia75
Contributor III
Contributor III

Measuring the gap between two matching tables

Hello

I have two tables:

     Table 1, with columns A, B and C

     and Table 2 with columns A, D and F

These two tables are linked by the field A (same name)

I would like to count the number of rows in the table 1, with column A does not match with table B and ditto for the table 2, the number of rows in the table 2,  with the column A does not match with the table A

thank you

P

1 Reply
Not applicable

Hi P,

you can't count key-fields, in your case column "A". If you need this, create a surrogato key (my fav for this is using the autonumber() - function) and decide wich column A you want to keep. If you need to count both columns A, my suggestion for your code would be similar to this:

LOAD

     autonumber(A,1) AS A_ID, //  key field for linking the tables

     A as A_1

From Table1

....

LOAD

     autonumber(A,1) AS A_ID,

     A as A_2

From Table2

Regards, Roland