Tmap difference on files

Six Stars

Tmap difference on files

Hello guys,

 

I'm trying to compare 2 files (XML) in a tMap and having only the difference between the files as output. (which will be CSV)

 

My job, for now, looks like : 

 

tFileInputXML ---main--->tMap ---> tlogrow

tfileinputXML ---lookup--> (to the same tmap)

 

My tmap is configured as following : Inner join / catch look up inner join reject : true. 

Its working all fine, once a line from lookup is not like my main row, i have it in my tlogrow. What i want to add is :

If my look up file has a line, and my main doesnt have this line anymore, i want the line with 0 as quantity. Any idea?

 

 

An example : on the left the main files, on the right the look up files, as you can see the first <stock> from right disappear (store code 0704 ......)

 samples.png

 

On my output i want for this case :

<store_code>0704</store_code>

<ean_sku>4067386843085</ean_sku>

<quantity>0</quantity>

<price>32.49</price>

<promo>24.39</price>

 

If anyone can help, would be much appreciate !


Accepted Solutions
Thirteen Stars

Re: Tmap difference on files

@daez,take as second file as a primary and first file as a lookup and get the inner join reject  and populate to same way with Hash output and read the same data load connect to tUnite,how i connected.

Manohar B

All Replies
Thirteen Stars

Re: Tmap difference on files

@daez,since you will not get the 0704 ,untill you change the file as a primary in tmap ,which has the 0704 data file .

Manohar B
Six Stars

Re: Tmap difference on files

Hi @manodwhb, thanks for the answer. Is there anyway to get my 0704 data while keeping the same main / look up row. If i change this, it wont get the "freshest" info from the first file ... I tried kinda all the jointure possible 

Thirteen Stars

Re: Tmap difference on files

@daez,since you need to split the flows .for the Reject you need design separte flow .as shown below.Untitled.png

Manohar B
Six Stars

Re: Tmap difference on files

@manodwhb , thanks for your time and screenshot ! So i cant do it in one time with a tMap if I get it right ?

Any chance i see your tXML map settings & tUnite ? 

 

Kindly

Six Stars

Re: Tmap difference on files

@manodwhb, Imagine I have 10 lines in my 2 files. On the most recent one, 3 data changed & one got deleted.

 

I want in my output only the 3 data changed & the line that have been deleted (so i get it from the second files). 

Your idea is to get the 3 data changed with one tMAP then the 1 that got deleted with another tMAP and then join those two new files with a tUnite. This is pretty smart, I didnt see it like that, thanks dude. I success to get the 3 lines, but the " one that got deleted " and need to be get on the second files, how do you do that ? 

How configure the tMap to get the only line that has been deleted in the first file from the second file? ? 

Thanks again

Thirteen Stars

Re: Tmap difference on files

@daez,take as second file as a primary and first file as a lookup and get the inner join reject  and populate to same way with Hash output and read the same data load connect to tUnite,how i connected.

Manohar B
Thirteen Stars

Re: Tmap difference on files

@daez,still do you have issue?

Manohar B
Thirteen Stars

Re: Tmap difference on files

@daez,Please provide Kudos also.

Manohar B