<?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 a table with another table using subset of first table's key in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329333#M704337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reynald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can build an intermediate lookup table to join the two tables as this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lkp:&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,5)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,6)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,7)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;inner join (Lkp)&lt;/P&gt;&lt;P&gt;LOAD text(CodeGroup) as Key, GroupName resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the text statement around the Code field as the CodeGroup values are numeric whereas the Codes are not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 May 2012 14:19:06 GMT</pubDate>
    <dc:creator>flipside</dc:creator>
    <dc:date>2012-05-30T14:19:06Z</dc:date>
    <item>
      <title>Join a table with another table using subset of first table's key</title>
      <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329331#M704335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the title might be confusing but here is the idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables and I want to join both tables, but.... &lt;/P&gt;&lt;P&gt;here is the case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="169" style="border: 1px solid #000000; width: 274px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.110.255&lt;/TD&gt;&lt;TD&gt;Desc1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.100.202&lt;/TD&gt;&lt;TD&gt;Desc2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.200.301&lt;/TD&gt;&lt;TD&gt;Desc3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.110.111&lt;/TD&gt;&lt;TD&gt;Desc4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.100.200&lt;/TD&gt;&lt;TD&gt;Desc5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;302.300.100&lt;/TD&gt;&lt;TD&gt;Desc6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 276px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;CodeGroup&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;STRONG style="color: #ffffff;"&gt;GroupName&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.1&lt;/TD&gt;&lt;TD&gt;Current Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.200&lt;/TD&gt;&lt;TD&gt;Fixed Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.11&lt;/TD&gt;&lt;TD&gt;Income&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.10&lt;/TD&gt;&lt;TD&gt;Other Income&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;302.3&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Other Income&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expected result is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="169" style="border: 1px solid #000000; width: 652px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;CodeGroup&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;GroupName&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.110.255&lt;/TD&gt;&lt;TD&gt;Desc1&lt;/TD&gt;&lt;TD&gt;101.1&lt;/TD&gt;&lt;TD&gt;Current Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.100.202&lt;/TD&gt;&lt;TD&gt;Desc2&lt;/TD&gt;&lt;TD&gt;101.1&lt;/TD&gt;&lt;TD&gt;Current Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101.200.301&lt;/TD&gt;&lt;TD&gt;Desc3&lt;/TD&gt;&lt;TD&gt;101.200&lt;/TD&gt;&lt;TD&gt;Fixed Asset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.110.111&lt;/TD&gt;&lt;TD&gt;Desc4&lt;/TD&gt;&lt;TD&gt;202.11&lt;/TD&gt;&lt;TD&gt;Income&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;202.100.200&lt;/TD&gt;&lt;TD&gt;Desc5&lt;/TD&gt;&lt;TD&gt;202.10&lt;/TD&gt;&lt;TD&gt;Other Income&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;302.300.100&lt;/TD&gt;&lt;TD&gt;Desc6&lt;/TD&gt;&lt;TD&gt;302.3&lt;/TD&gt;&lt;TD&gt;Other Income&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show which code belong to which CodeGroup and GroupName.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 12:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329331#M704335</guid>
      <dc:creator />
      <dc:date>2012-05-30T12:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Join a table with another table using subset of first table's key</title>
      <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329332#M704336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that are the only data you have to join, you could create two fields in both tables with the first 5,6 characters so you will have the Keys to join the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;Left(Code,5) as %Key,&lt;/P&gt;&lt;P&gt;Left(Code,6) as %Key2&lt;/P&gt;&lt;P&gt;From TABLE1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left join(Table1)&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;if(len(CodeGroup)=5,Left(CodeGroup,5)) as %Key&lt;/P&gt;&lt;P&gt;From TABLE2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left join(Table1)&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;if(len(CodeGroup)&amp;gt;5,Left(CodeGroup,6)) as %Key2&lt;/P&gt;&lt;P&gt;From TABLE2;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I ' ve don't try this, hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 12:52:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329332#M704336</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-05-30T12:52:59Z</dc:date>
    </item>
    <item>
      <title>Join a table with another table using subset of first table's key</title>
      <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329333#M704337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reynald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can build an intermediate lookup table to join the two tables as this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lkp:&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,5)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,6)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;LOAD Code, text(left(Code,7)) as Key resident Table1;&lt;/P&gt;&lt;P&gt;inner join (Lkp)&lt;/P&gt;&lt;P&gt;LOAD text(CodeGroup) as Key, GroupName resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the text statement around the Code field as the CodeGroup values are numeric whereas the Codes are not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 14:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329333#M704337</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-05-30T14:19:06Z</dc:date>
    </item>
    <item>
      <title>Join a table with another table using subset of first table's key</title>
      <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329334#M704338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for ur help btw.&lt;/P&gt;&lt;P&gt;I havent tried any of the solution&lt;/P&gt;&lt;P&gt;but once Ive tried, i will inform my progress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 14:41:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329334#M704338</guid>
      <dc:creator />
      <dc:date>2012-05-31T14:41:31Z</dc:date>
    </item>
    <item>
      <title>Join a table with another table using subset of first table's key</title>
      <link>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329335#M704339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks flipside,&lt;/P&gt;&lt;P&gt;Your solution worked like charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much. &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, 01 Jun 2012 09:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-a-table-with-another-table-using-subset-of-first-table-s/m-p/329335#M704339</guid>
      <dc:creator />
      <dc:date>2012-06-01T09:36:40Z</dc:date>
    </item>
  </channel>
</rss>

