Unable to compare columns in two excels using Tmap

Four Stars

Unable to compare columns in two excels using Tmap

Hello Team,

 

I m trying to compare data in two excels using Tmap and create a excel output which will have all the records that dont match.My excel data has an ID column and few other columns like Age, Gender, Address, etc. I am able to compare the excels and pin point which ID has mismatches. But unable to identify the column having differences. I tried using the Tmap expression, and the test button there gives me correct result, but final data is not showing proper.

 

This was my excel input :

idAgeGender
12325Female

 

Look Up input :

idAgeGender
12324Female

 

And my output  came out as below:

idAgeGender
123Not Equal Not Equal

 

Gender being same gave me 'Not Equal'

 

I gave my tmap expression as :

row1.Age == row2.Age  , but didnt work. Tired converting to string as below. But that too failed.

String.valueOf(row1.Age) .equals(String.valueOf(row2.Age)) ? "Equal" : "Not Equal" 

 

Please help!

Five Stars

Re: Unable to compare columns in two excels using Tmap

Hi,

Along with id join age as key column and try inner join.To catch the reject set inner join reject true.Capture.PNG

Six Stars

Re: Unable to compare columns in two excels using Tmap

Hi Priya,

 

I am attaching he mapping and tmap settings.

I have created two variables with string datatype 

row2.age.equals(row2.age)?"Equal":"Not Equal" 

row1.gender.equals(row2.gender)?"Equal":"Not Equal" 

 

Let me know if it worked.

Four Stars

Re: Unable to compare columns in two excels using Tmap

I Have given inner join true to get the rejected records.

And have attempted the same settings, but still throwing me a 'Not Equal' result.Tmap_Settings.JPG

Six Stars

Re: Unable to compare columns in two excels using Tmap

hi priyajr,

dont check ineer join on all the columns.just do on ID column.

 

 

Four Stars

Re: Unable to compare columns in two excels using Tmap

Hi Aaryan,

 

I had tried that as well, but in that case i m not getting the rejected records in my file.

 

Tmap_ID_Join.JPG

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download