<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Merge two files in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356818#M122260</link>
    <description>I got this working with 3 Subjobs connected by OnComponentOk:
&lt;BR /&gt;
&lt;PRE&gt;tFileInputDelimited_1 --&amp;gt; tMap_1 --&amp;gt; tFileOutputDelimited_1&lt;BR /&gt;OnComponentOk&lt;BR /&gt;tFileInputDelimited_2 --&amp;gt; tMap_2 --&amp;gt; tFileOutputDelimited_2&lt;BR /&gt;OnComponentOk&lt;BR /&gt;tFileInputDelimited_3 --&amp;gt; tSortRow_1 --&amp;gt; tDenormalizeSortedRow_1 --&amp;gt; tMap_3 --&amp;gt; tLogRow_1&lt;/PRE&gt;
&lt;BR /&gt;The first two subjobs output both files into one file:
&lt;BR /&gt;The output schema for the tMaps are both: PName,countA,countB
&lt;BR /&gt;In tMap1 map pname and countA, not countB of course.
&lt;BR /&gt;In tMap2 map pname and countB, not countA of course.
&lt;BR /&gt;The output from tMap1 lands in the file and truncates any content.
&lt;BR /&gt;The output from tMap2 appends. (Set "Append" for tFileOutputDelimited_2!)
&lt;BR /&gt;Both files are now "merged" into one file, just not how you want.
&lt;BR /&gt;This is a temporary file.
&lt;BR /&gt;The third subjob reads the merged temp-file, sorts the rows and runs them past tDenormalizeSortedRow.
&lt;BR /&gt;tDenormalizeSortedRow seems to want strings for columnA and columnB 
&lt;BR /&gt;so set the count columns for this section to string and not as integer in the file input schema of tFileInputDelimited_3.
&lt;BR /&gt;Set both columnA and columnB to denormalize.
&lt;BR /&gt;Important: use no delimiter in tDenormalizeSortedRow. Set the delimiter to "".
&lt;BR /&gt;(I assume your input rows have unique keys!)
&lt;BR /&gt;tMap3 sets empty fields to 0 as in your requirement:
&lt;BR /&gt;Something along the lines of-
&lt;BR /&gt;(StringHandling.LEN(row5.countA) &amp;gt; 0) ? row5.countA : "0"
&lt;BR /&gt;Cast countA and countB to integer if you need to.</description>
    <pubDate>Sat, 23 Feb 2013 13:18:54 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2013-02-23T13:18:54Z</dc:date>
    <item>
      <title>Merge two files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356817#M122259</link>
      <description>Hello,&lt;BR /&gt;I guess that my problem has been solved many times. However, I've struggled for two days with Components help, google search, tMap, tJoin, tUnite and I can't find my way out.&lt;BR /&gt;Basically, I want to merge file A&lt;BR /&gt;PName|Count A&lt;BR /&gt;A|7&lt;BR /&gt;B|24&lt;BR /&gt;D|10&lt;BR /&gt;E|11&lt;BR /&gt;with file B&lt;BR /&gt;PName|Count B&lt;BR /&gt;A|9&lt;BR /&gt;C|13&lt;BR /&gt;D|1&lt;BR /&gt;F|8&lt;BR /&gt;to get file C such as&lt;BR /&gt;PName|Count A|Count B&lt;BR /&gt;A|7|9&lt;BR /&gt;B|24|0&lt;BR /&gt;C|0|13&lt;BR /&gt;D|10|1&lt;BR /&gt;E|11|0&lt;BR /&gt;F|0|8&lt;BR /&gt;Thanks a lot for your help.&lt;BR /&gt;Cheers</description>
      <pubDate>Sat, 23 Feb 2013 10:04:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356817#M122259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-23T10:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356818#M122260</link>
      <description>I got this working with 3 Subjobs connected by OnComponentOk:
&lt;BR /&gt;
&lt;PRE&gt;tFileInputDelimited_1 --&amp;gt; tMap_1 --&amp;gt; tFileOutputDelimited_1&lt;BR /&gt;OnComponentOk&lt;BR /&gt;tFileInputDelimited_2 --&amp;gt; tMap_2 --&amp;gt; tFileOutputDelimited_2&lt;BR /&gt;OnComponentOk&lt;BR /&gt;tFileInputDelimited_3 --&amp;gt; tSortRow_1 --&amp;gt; tDenormalizeSortedRow_1 --&amp;gt; tMap_3 --&amp;gt; tLogRow_1&lt;/PRE&gt;
&lt;BR /&gt;The first two subjobs output both files into one file:
&lt;BR /&gt;The output schema for the tMaps are both: PName,countA,countB
&lt;BR /&gt;In tMap1 map pname and countA, not countB of course.
&lt;BR /&gt;In tMap2 map pname and countB, not countA of course.
&lt;BR /&gt;The output from tMap1 lands in the file and truncates any content.
&lt;BR /&gt;The output from tMap2 appends. (Set "Append" for tFileOutputDelimited_2!)
&lt;BR /&gt;Both files are now "merged" into one file, just not how you want.
&lt;BR /&gt;This is a temporary file.
&lt;BR /&gt;The third subjob reads the merged temp-file, sorts the rows and runs them past tDenormalizeSortedRow.
&lt;BR /&gt;tDenormalizeSortedRow seems to want strings for columnA and columnB 
&lt;BR /&gt;so set the count columns for this section to string and not as integer in the file input schema of tFileInputDelimited_3.
&lt;BR /&gt;Set both columnA and columnB to denormalize.
&lt;BR /&gt;Important: use no delimiter in tDenormalizeSortedRow. Set the delimiter to "".
&lt;BR /&gt;(I assume your input rows have unique keys!)
&lt;BR /&gt;tMap3 sets empty fields to 0 as in your requirement:
&lt;BR /&gt;Something along the lines of-
&lt;BR /&gt;(StringHandling.LEN(row5.countA) &amp;gt; 0) ? row5.countA : "0"
&lt;BR /&gt;Cast countA and countB to integer if you need to.</description>
      <pubDate>Sat, 23 Feb 2013 13:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356818#M122260</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-02-23T13:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two files</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356819#M122261</link>
      <description>hi, 
&lt;BR /&gt;you have to denormalize your data. 
&lt;BR /&gt;1- fill empty column with 0 as value. (you've done the job) 
&lt;BR /&gt;2- read &amp;amp; unite the data 
&lt;BR /&gt;3- denormalize the data . 
&lt;BR /&gt; here 's screenshot for 2&amp;amp;3. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;hope it help 
&lt;BR /&gt;regards 
&lt;BR /&gt;laurent 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDw4.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150110i34EDBAF2AE315B52/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDw4.jpg" alt="0683p000009MDw4.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 25 Feb 2013 14:02:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Merge-two-files/m-p/2356819#M122261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-25T14:02:24Z</dc:date>
    </item>
  </channel>
</rss>

