<?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: Implementing complex join in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206187#M6352</link>
    <description>one not-so elegant solution would be to do the join without the OR in the tmap, and then in the inner join reject output table apply an output filter that checks for the zero values. you can then recombine the flows or simply use two different components to do all your inserts.</description>
    <pubDate>Tue, 03 Aug 2010 00:30:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-08-03T00:30:34Z</dc:date>
    <item>
      <title>Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206184#M6349</link>
      <description>Hi!
&lt;BR /&gt;I'm pretty new with talend and I hit a problem. I dont see how I can implement the solution so here it goes...
&lt;BR /&gt;In a normal lookup, you left join on a key and return several columns. To acheive my goal, i've to do the exact opposite : join on several non key column and return the key if there is a match. In other word, I want to find a pattern an extract the key if it exist. On one side you have several transactions (with several properties) to process. On the other you have several transaction pattern (with several propeties) and the goal is to find one patten that fit each transactions.
&lt;BR /&gt;The SQL to accheive this is fairly simple:
&lt;BR /&gt;
&lt;PRE&gt;select t.fk_transaction_code,&lt;BR /&gt;       s.fk_system,&lt;BR /&gt;       s.fk_customer,&lt;BR /&gt;       s.fk_partner&lt;BR /&gt;from   source.v_mapping_source s&lt;BR /&gt;       left join ods.v_mapping_target t on (s.fk_system   = t.fk_system            OR t.fk_system            = 0)&lt;BR /&gt;                                       and (s.fk_function = t.fk_function          OR t.fk_function          = 0)&lt;BR /&gt;                                       and (s.fk_customer = t.fk_netsuite_customer OR t.fk_netsuite_customer = 0)&lt;BR /&gt;                                       and (s.fk_partner  = t.fk_netsuite_partner  OR t.fk_netsuite_partner  = 0)&lt;/PRE&gt;
&lt;BR /&gt;-The left join itself ensure a result for all row in the source
&lt;BR /&gt;- The OR on each part of the join ensure that if a match is not found, use the default value for the property (wich is zero).
&lt;BR /&gt;If I put in my join something like:
&lt;BR /&gt;
&lt;PRE&gt;       left join ods.v_mapping_target t on s.fk_system   = t.fk_system&lt;BR /&gt;                                       and s.fk_function = t.fk_function&lt;BR /&gt;                                       and s.fk_customer = t.fk_netsuite_customer&lt;BR /&gt;                                       and s.fk_partner  = t.fk_netsuite_partner&lt;/PRE&gt;
&lt;BR /&gt;I would only hit a result when all 4 propeties were set. the OR allow me to hit a result if one or more property is not set.</description>
      <pubDate>Sat, 16 Nov 2024 13:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206184#M6349</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206185#M6350</link>
      <description>My question is how to modify my tmap to hendle these OR clause in the lef join.
&lt;BR /&gt;I'm going to look for the proper way to add an image of my tmap.</description>
      <pubDate>Mon, 02 Aug 2010 19:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206185#M6350</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2010-08-02T19:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206186#M6351</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;My question is how to modify my tmap to hendle these OR clause in the lef join.&lt;BR /&gt;I'm going to look for the proper way to add an image of my tmap.&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;I put a red square in SQL would be :
&lt;BR /&gt;
&lt;PRE&gt;row6.fk_partner = row17.fk_netsuite_partner.&lt;/PRE&gt;
&lt;BR /&gt;What should I change in the tmap to have 
&lt;BR /&gt;
&lt;PRE&gt;row6.fk_partner = row17.fk_netsuite_partner OR row17.fk_netsuite_partner = 0&lt;/PRE&gt;
&lt;BR /&gt;instead?
&lt;BR /&gt;Any help would be appreciated.
&lt;BR /&gt;Sorry for my english. Not my first language!</description>
      <pubDate>Mon, 02 Aug 2010 19:23:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206186#M6351</guid>
      <dc:creator>manueld</dc:creator>
      <dc:date>2010-08-02T19:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206187#M6352</link>
      <description>one not-so elegant solution would be to do the join without the OR in the tmap, and then in the inner join reject output table apply an output filter that checks for the zero values. you can then recombine the flows or simply use two different components to do all your inserts.</description>
      <pubDate>Tue, 03 Aug 2010 00:30:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206187#M6352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-03T00:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206188#M6353</link>
      <description>Instead of joining those fields directly in the lookup (e.g. your red square), activate the expression filter for the lookup (white arrow with green plus) with the following: 
&lt;BR /&gt; 
&lt;PRE&gt;(row6.fk_system==row17.fk_system || row17.fk_system==0)&lt;BR /&gt;&amp;amp;&amp;amp; (row6.fk_function==row17.fk_function || row17.fk_function==0)&lt;BR /&gt;&amp;amp;&amp;amp; (row6.fk_customer==row17.fk_netsuite_customer || row17.fk_netsuite_customer==0)&lt;BR /&gt;&amp;amp;&amp;amp; (row6.fk_partner==row17.fk_netsuite_partner || row17.fk_netsuite_partner==0)&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Aug 2010 04:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206188#M6353</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-08-08T04:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing complex join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206189#M6354</link>
      <description>This is great. With this solution, you maid me understand so much stuff about the tmap.&lt;BR /&gt;Thanks a lot!!!</description>
      <pubDate>Mon, 09 Aug 2010 18:53:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Implementing-complex-join/m-p/2206189#M6354</guid>
      <dc:creator>manueld</dc:creator>
      <dc:date>2010-08-09T18:53:38Z</dc:date>
    </item>
  </channel>
</rss>

