Hello everyone, I will need your help please, I have two excel file in input, I must check for each line of the first excel file the line which corresponds to it in the line of the second excel file and that one compares with the contents of each columns knowing that I have 8 columns with compare I tried with the tmap but I can not get the right result
Thank you in advance for your help
Do you have a key in both the files? Something like an Id field? Are you guaranteed to have every row in both files? Is there one file that will definitely have all rows and another file that will have a subset of those row? Or could the files have very different rows (for example, file 1 has rows 1,3,5,7 and file 2 has rows 2,4,6,8)? If you can give us a bit more info, that would really help
OK, well one way you can do it is to use a tMap. The tMap works by having a Main flow and lookup flows. One of your files will be the main flow, the other will be a lookup flow. Now this method is a simple way of doing it and will only work so long as the the main flow file has every row that is in the lookup flow. This is because the flow of data is driven by the main flow. You will want to join on your key field. Then the 8 fields you want to compare will need to be compared in tMap variables (the variables box in-between the input and output tables). These comparisons will have to be written according to the type of data and what result you want. Maybe you want simply a true for a match and false for a non-match? Maybe you want to set an overwrite priority (file 1 overwrites file 2 values)? You will need to think about that.
The first thing to do is probably just to ensure you have created the join appropriately by simply outputting all columns to a tLogRow to see that everything is how you expect.
Why do you think it would crash? Have you tried this and experienced a crash?
From what you have said, the way I would do this would be to use the tMap variables to check each column and return true for match and false for a non match. Then, in the output table, filter it with the result of the tMap variables.
!Var.Column1 || !Var.Column2 || !Var.Column3 || !Var.Column4 || !Var.Column5 || !Var.Column6 || !Var.Column7 || !Var.Column8
This will return rows which have at least one column that does not match
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables