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!

5 REPLIES
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