<?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: Union with tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293182#M66182</link>
    <description>&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;That was perfect. Your approach did the job.&lt;/P&gt;&lt;P&gt;I have simplified it a little bit because I thought that the join between A (main) and B (lookup) is, in fact, not needed. I mean, all data from A will be taken, even when the data is present in B.&lt;/P&gt;&lt;P&gt;So, the tricky part is the join between B (main) and A (lookup), where only the unmatched have to be taken.&lt;/P&gt;&lt;P&gt;Finally, the data is stored and restore from hash tables before doing the merge. I'm not sure about why is this needed, but Talend does not allow me to merge the outputs directly without this components, so I think that is beyond my knowlegde in Talend.&lt;/P&gt;&lt;P&gt;Here the snapshots showing the job, the tMap configuration and the logs:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocO4AAI.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157046i56D48A6F5B9C845A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocO4AAI.jpg" alt="0693p000009ocO4AAI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocO9AAI.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156237iB890205487651F92/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocO9AAI.jpg" alt="0693p000009ocO9AAI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocOEAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130920i251553B81CA5C931/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocOEAAY.jpg" alt="0693p000009ocOEAAY.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
    <pubDate>Fri, 18 Sep 2020 08:54:02 GMT</pubDate>
    <dc:creator>Shalafi</dc:creator>
    <dc:date>2020-09-18T08:54:02Z</dc:date>
    <item>
      <title>Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293177#M66177</link>
      <description>&lt;P&gt;Hello, community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement that I am not sure how to accomplish in Talend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two similar tables (almost same scheme) in two different databases. I have to "merge" the data from both tables into one single output. Since the tables are in different databases, two different tDBInput components are used to get the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attending to one column (id), some rows could be found in both tables; in that case the row from table A is taken.&lt;/P&gt;&lt;P&gt;In other cases, I have data in table A that is not present in table B (attending to column id). In that case the row from table A is taken.&lt;/P&gt;&lt;P&gt;Until this point this could be accomplished with a "TableA LEFT JOIN TableB" structure, but...&lt;/P&gt;&lt;P&gt;In other cases, I have data in table B that is not present in table A (attending to column id). In that case the row from table B is taken.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table A:&lt;/P&gt;&lt;P&gt;ID OTHER_FIELD&lt;/P&gt;&lt;P&gt;1 A_1&lt;/P&gt;&lt;P&gt;2 A_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table B:&lt;/P&gt;&lt;P&gt;ID OTHER_FIELD&lt;/P&gt;&lt;P&gt;1 B_1&lt;/P&gt;&lt;P&gt;3 B_3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;ID OTHER_FIELD&lt;/P&gt;&lt;P&gt;1 A_1 -&amp;gt; present in both tables; taken from A&lt;/P&gt;&lt;P&gt;2 A_2 -&amp;gt; only present in table A&lt;/P&gt;&lt;P&gt;3 B_3 -&amp;gt; only present in table B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure how to develop this requirement in Talend. I think I have to use tMap, but I need some example about its configuration for this particular scenario. Maybe I'm wrong and tMap is not the better option; in that case, please let me know your suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you somuch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;if I could perform a single query over both tables (I can't since they are in different databases), this query should do the job:&lt;/P&gt;&lt;P&gt;select &lt;A href="http://a.id" alt="http://a.id" target="_blank"&gt;a.id&lt;/A&gt;, a.other_column&lt;/P&gt;&lt;P&gt;from table_a a left join table_b b on &lt;A href="http://a.id" alt="http://a.id" target="_blank"&gt;a.id&lt;/A&gt; = &lt;A href="http://b.id" alt="http://b.id" target="_blank"&gt;b.id&lt;/A&gt;&lt;/P&gt;&lt;P&gt;union&lt;/P&gt;&lt;P&gt;select &lt;A href="http://b.id" alt="http://b.id" target="_blank"&gt;b.id&lt;/A&gt;, b.other_column&lt;/P&gt;&lt;P&gt;from table_b b left join table_a a on &lt;A href="http://a.id" alt="http://a.id" target="_blank"&gt;a.id&lt;/A&gt; = &lt;A href="http://b.id" alt="http://b.id" target="_blank"&gt;b.id&lt;/A&gt;&lt;/P&gt;&lt;P&gt;where &lt;A href="http://a.id" alt="http://a.id" target="_blank"&gt;a.id&lt;/A&gt; is null&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293177#M66177</guid>
      <dc:creator>Shalafi</dc:creator>
      <dc:date>2024-11-16T01:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293178#M66178</link>
      <description>&lt;P&gt;&lt;B&gt;Hi &amp;nbsp;&lt;/B&gt;&lt;A href="https://community.talend.com/s/profile/0053p000007LR8hAAG" alt="https://community.talend.com/s/profile/0053p000007LR8hAAG" target="_blank"&gt;&lt;B&gt;Shalafi&lt;/B&gt;&lt;/A&gt;&lt;B&gt;,&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the Schema of the tables and data type is same then you can get this by using tUnite component. Please go through below link:&lt;/P&gt;&lt;P&gt;https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/2YsQPg30hhoQZ9rHExZ9Qw&lt;/P&gt;&lt;P&gt;https://help.talend.com/reader/WfrS1ZaBst3az8zJBGoMSQ/reordz4zg7ldIHmFzxqd9w&lt;/P&gt;&lt;P&gt;Let me know if helps &lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 05:48:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293178#M66178</guid>
      <dc:creator>vikramk</dc:creator>
      <dc:date>2020-09-18T05:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293179#M66179</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;You need to do inner join two times, please refer to this KB &lt;A href="https://community.talend.com/s/article/Doing-an-inner-join-using-a-tMap-component-i5Mrr" alt="https://community.talend.com/s/article/Doing-an-inner-join-using-a-tMap-component-i5Mrr" target="_blank"&gt;articles&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The first time, table A is main table and table B is lookup table, do an inner join based on id column and get the matched rows, store the result to memory using tHashOutput for used later. &lt;/P&gt;&lt;P&gt;The second time, table B is main table and table A is lookup table, do an inner join based on id column and get the unmatched rows ( these rows only present in table B), store the result to memory for used later . &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, read back the two output from memory using tHashInput and merge them. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 07:10:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293179#M66179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-18T07:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293180#M66180</link>
      <description>&lt;P&gt;Hello. Thank you for your answer.&lt;/P&gt;&lt;P&gt;Unfortunately, this method does not do the job. The tUnite simply merge data from both tables and does not take into account the requirement about the same id (the join part). Anyway, I made a test to confirm that and as I said, the result is not the expected one (the rows marked in red should not be present). You can see this test in the image.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocM3AAI.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140717i0EEE9A5A65427CA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocM3AAI.jpg" alt="0693p000009ocM3AAI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 07:29:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293180#M66180</guid>
      <dc:creator>Shalafi</dc:creator>
      <dc:date>2020-09-18T07:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293181#M66181</link>
      <description>&lt;P&gt;Hi. Thank you for your answer.&lt;/P&gt;&lt;P&gt;Uoo! This is pretty simple once is read (simple solutions are always good solutions). In fact, this is a direct porting of the SQL that I shared, so this is perfect. Let me make a test to confirm that the approach is working and I will share the result.&lt;/P&gt;&lt;P&gt;Thank you so much again&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 07:33:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293181#M66181</guid>
      <dc:creator>Shalafi</dc:creator>
      <dc:date>2020-09-18T07:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293182#M66182</link>
      <description>&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;That was perfect. Your approach did the job.&lt;/P&gt;&lt;P&gt;I have simplified it a little bit because I thought that the join between A (main) and B (lookup) is, in fact, not needed. I mean, all data from A will be taken, even when the data is present in B.&lt;/P&gt;&lt;P&gt;So, the tricky part is the join between B (main) and A (lookup), where only the unmatched have to be taken.&lt;/P&gt;&lt;P&gt;Finally, the data is stored and restore from hash tables before doing the merge. I'm not sure about why is this needed, but Talend does not allow me to merge the outputs directly without this components, so I think that is beyond my knowlegde in Talend.&lt;/P&gt;&lt;P&gt;Here the snapshots showing the job, the tMap configuration and the logs:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocO4AAI.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157046i56D48A6F5B9C845A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocO4AAI.jpg" alt="0693p000009ocO4AAI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocO9AAI.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156237iB890205487651F92/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocO9AAI.jpg" alt="0693p000009ocO9AAI.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ocOEAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130920i251553B81CA5C931/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ocOEAAY.jpg" alt="0693p000009ocOEAAY.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 08:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293182#M66182</guid>
      <dc:creator>Shalafi</dc:creator>
      <dc:date>2020-09-18T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Union with tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293183#M66183</link>
      <description>&lt;P&gt;Great, glad to see you get it working! Thanks for your feedback!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 09:23:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Union-with-tMap/m-p/2293183#M66183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-18T09:23:10Z</dc:date>
    </item>
  </channel>
</rss>

