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: 
profuse
Creator
Creator

[resolved] Compare 2 files

Hi,
I've been reviewing the forum on how to compare 2 files and still can't get the desired results. Here is what I'm trying to do:
I have two csv files with the identical columns. The first input file has 4901 rows, the second has 4797 rows. I'm trying to compare the files and create a output file  that should show the rows that are not in the second file (104) rows.
I'm using the tMap and I've connected the columns of row1 to row2 and set row2 Join Model to Inner Join. On the output file I set the Catch output reject to false and the Catch lookup inner join reject to true. When I run the job, the output files contains all  of the first file 4901 rows. I want it to contain the 104 rejected rows.
Please help, what do I need to change?
Thank you.
Labels (3)
1 Solution

Accepted Solutions
profuse
Creator
Creator
Author

Got it to work... the problem was one of the input files was delimited by ; the  other was delimited by ,
Thanks for all your help!

View solution in original post

9 Replies
Anonymous
Not applicable

Hi,
Could you please show us your tMap editor screenshot? 
I have designed a demo job to achieve your goal.
Best regards
Sabrina
0683p000009MB4L.png 0683p000009MB0Z.png 0683p000009MAoT.png 0683p000009MAXm.png
profuse
Creator
Creator
Author

Hi Xdshi,
Here is my current tmap screenshot:
0683p000009MB4Q.png
In your demo you use tFixedFlowInput but I don't see were I select the input file name for my CSV files? Also instead of using the tLogRow I need to send the results to a CSV output file. Can this be done? 
How should I proceed?
Thanks
Anonymous
Not applicable

You need to replace these example components with tFileInputDelimited and tFileOutputDelimited
profuse
Creator
Creator
Author

After making the above changes this is how the job design looks and when I run it the output file still contains 4899 rows (not the 104 rejected rows). How should I proceed?
0683p000009MAUB.png
Thanks
Anonymous
Not applicable

Using the example that you were given, you need two outputs. One for the inner join matches and one for the rejects (the one you're looking for).
I'm also guessing that you have an outer-join not an inner join.
Go back the the example you were given.
profuse
Creator
Creator
Author

tal0000/xdshi: I made adjustments and still does not work. Here are my screenshots.
Please advise.
0683p000009MAfm.png 0683p000009MB4V.png
Anonymous
Not applicable

You're catching output rejects. you need to catch inner join rejects (delimited 2).
As you've got nothing going to delimited 1, your join is failing for all rows which may or may not be what you're expecting.
profuse
Creator
Creator
Author

Got it to work... the problem was one of the input files was delimited by ; the  other was delimited by ,
Thanks for all your help!
Anonymous
Not applicable

Hi profuse,
Great it is fixed. Thanks for posting that this issue has been set as resolved.
Best regards
Sabrina