Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
JABELLA1634831127
Contributor III
Contributor III

Getting rows with differences between two data tables

0695b00000LySNWAA3.png

Hi so I currently have this tmap which gets all rows with differences between two tables. The problem is it also gets additional rows in the first table that is not in the second table. How can I get only rows with differences not including rows present in data table 1 but not present in data table 2.

Labels (2)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi maybe you can add a filter expression on the output to check if a specific field of row6 is null, to throw away row from row5 wich are not present in row6.

Send me love and kudos

View solution in original post

16 Replies
gjeremy1617088143

Hi maybe you can add a filter expression on the output to check if a specific field of row6 is null, to throw away row from row5 wich are not present in row6.

Send me love and kudos

JABELLA1634831127
Contributor III
Contributor III
Author

Hi sorry can you give me an example, I've never tried using filter expression.

gjeremy1617088143

https://help.talend.com/r/en-US/7.3/tmap/filter-expressions

and inside for eg you can add :

row6.Short_Name != null

 

cause when you catch inner join reject you also catch record wich are present in row5 and not row 6 so these record have null value in all their fields in row 6

JABELLA1634831127
Contributor III
Contributor III
Author

When I tried this one, I got 0 rows as my output.

gjeremy1617088143

you have to use a field wich is not nullable maybe by default your short name is always null

JABELLA1634831127
Contributor III
Contributor III
Author

Does this mean unticking the nullable column?

gjeremy1617088143

i've testing it and the row6 column will be always null due to inner join reject, have you a specific key to identify input wich can be already exist ?

if you have then first make an inner join on the key then after you get the result you can check difference between the two table

JABELLA1634831127
Contributor III
Contributor III
Author

My specific key is short_name, both tables don't have null values in that key.

gjeremy1617088143

so first make an inner join only on the short name , then with the output make an inner join with all the fields and get the catch inner join reject as the result. For the first join instead of a tmap you can use a tJoin component , you have to call the second table for the two join so you can stock it in a hash and call the hash two time.