<?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 join two tables by substring in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942805#M646881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to join two tables by a substring like is shown with a picture below, but I didn't have any luck with it.&lt;/P&gt;&lt;P&gt;Can you please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="substringjoin.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/101527_substringjoin.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the picture, I want to join Table2 to Table1, where Field C is primary key and a substring to Field A from Table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate some help and thank you on advance &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Oct 2015 08:04:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-09T08:04:29Z</dc:date>
    <item>
      <title>join two tables by substring</title>
      <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942805#M646881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to join two tables by a substring like is shown with a picture below, but I didn't have any luck with it.&lt;/P&gt;&lt;P&gt;Can you please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="substringjoin.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/101527_substringjoin.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the picture, I want to join Table2 to Table1, where Field C is primary key and a substring to Field A from Table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate some help and thank you on advance &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 08:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942805#M646881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-09T08:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables by substring</title>
      <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942806#M646882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it always is character 2,3, and 4 from FieldA that should be used, then you can create a new field&lt;/P&gt;&lt;P&gt;&amp;nbsp; Mid(FieldA, 2, 3) as Key&lt;/P&gt;&lt;P&gt;and make your join on this key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I suspect you want a more general solution, and if so, it could be a challenge, I would explore the option of creating a mapping table from table 2 and use mapsubstring() instead of a join. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942806#M646882</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-10-09T09:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables by substring</title>
      <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942807#M646884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may use the following script and the table "Final" has the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;FieldA, FieldB&lt;/P&gt;&lt;P&gt;abcde,123&lt;/P&gt;&lt;P&gt;fghjk,456&lt;/P&gt;&lt;P&gt;lmnop,789&lt;/P&gt;&lt;P&gt;qrstu,111&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;FieldC, FieldD&lt;/P&gt;&lt;P&gt;rst,222&lt;/P&gt;&lt;P&gt;mno,333&lt;/P&gt;&lt;P&gt;ghj,444&lt;/P&gt;&lt;P&gt;bcd,555&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outer Join (Table1) LOAD * Resident Table2;&lt;/P&gt;&lt;P&gt;Drop Table Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD FieldA, FieldB, FieldC, FieldD Resident Table1&lt;/P&gt;&lt;P&gt;where Index(FieldA, FieldC) &amp;gt; 0;&lt;/P&gt;&lt;P&gt;Drop Table Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:27:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942807#M646884</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2015-10-09T09:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables by substring</title>
      <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942808#M646886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have worked out something. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; , yeah, it's a bit tricky.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Table1:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Load * Inline [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;FieldA, FieldB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;abcde, 123&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;fghik, 456&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;lmnop, 789&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;qrstu, 111&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Table2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Load * Inline [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;FieldC, FieldD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;rst, 222&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;mno, 333&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;ghi, 444&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;bcd, 555&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Map:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Mapping Load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; FieldC,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&lt;STRONG&gt;&amp;nbsp; '_'&amp;amp;FieldC&amp;amp;'_'&amp;amp;FieldD as New&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Resident Table2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Final:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; &lt;STRONG&gt;SubField(MapSubString('Map', FieldA), '_',2) as FieldC,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; FieldA,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; FieldB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; FieldC,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;&amp;nbsp; FieldD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva;"&gt;Resident Table2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva; font-size: 10pt; line-height: 1.5em;"&gt;Drop table Table1, Table2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva; font-size: 10pt; line-height: 1.5em;"&gt;Note: Under-score ('_') as been taken to separate out the sub strings assuming there would not be any '_' in your key fields.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942808#M646886</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-10-09T09:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables by substring</title>
      <link>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942809#M646887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all very much for your answers and effort. You helped me a lot &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/join-two-tables-by-substring/m-p/942809#M646887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-09T09:59:28Z</dc:date>
    </item>
  </channel>
</rss>

