<?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: Associating tables on variable length field WITH wildcards in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829795#M292056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the three table approach worked, because my user was happy to have the final tables segregated by length of code, so I created associative fields by taking the full length HS code from CBR ("Records" in the diagram), and taking LEFT 4, 6, 8 respectively to get:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SSCode.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/87290_SSCode.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I created three pivot tables. Since another requirement was to show all the values from the HSTx tables, regardless of whether there was a match in RECORDS, I used the fields "SSDesc" from the HSTx tables as my first dimension and selected "Show All Values" for it, then select the "HSTx.HSMatch" fields as the second dimension, and selected "Suppress If Null". for it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 May 2015 12:59:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-22T12:59:18Z</dc:date>
    <item>
      <title>Associating tables on variable length field WITH wildcards</title>
      <link>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829793#M292054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hooboy.. when you import stuff into Canada or the US, you use a "Harmonised Service Code" (HSCODE). A full HS Code is 8 digits, but they are often subgrouped by chapter and heading into a format such as "16.02.3456", where "16" is the chapter and "02" is the heading. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an 11+ million record file (CBR) where the HSCODE is ALWAYS 8 full digits. Then I have a spreadsheet where the HSCode could be&amp;nbsp; in forms such as "1.02" or "16.94" or "220470" or even "89076504" (call these "SSCodes" for spreadsheet codes). I need to read in the spreadsheet, and then match the SSCodes with the CBR.HSCODE where, e.g. SSCode "1.02" would match any CBR.HSCode "0102????".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dealt with the periods in the original format in my LOAD statement:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Replace([HS Match],'.','') as HSM,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Len(Replace([HS Match],'.','')) as HSL,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this ends up giving me a mix of HSM's that are 4,6,8 digits long. I split them into three separate tables, using a WHERE clause based on HSM length. How can I create an association between the tables? The only thing I can think of is to create three tables where I take all the 4-digits HSM's and JOIN to CBR on HST4.HSM=LEFT(CBR.HSCODE,4),, another where I join on HST6.HSM=LEFT(CBR.HSCODE,6), etc. However, this seems clumsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final wrinkle is I'm supposed to display all the HSM's, regardless of whether there's a match in the CBR file or not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another, smarter, more elegant way to associate the tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 19:30:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829793#M292054</guid>
      <dc:creator />
      <dc:date>2015-05-21T19:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Associating tables on variable length field WITH wildcards</title>
      <link>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829794#M292055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One possible approach is load codes like &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;1.02 and generate FROM and TO fields 1020000 to 10299999 and use intervalmatch to match those records&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further reading : &lt;A href="https://community.qlik.com/qlik-blogpost/3037"&gt;IntervalMatch&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 20:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829794#M292055</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-05-21T20:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Associating tables on variable length field WITH wildcards</title>
      <link>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829795#M292056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the three table approach worked, because my user was happy to have the final tables segregated by length of code, so I created associative fields by taking the full length HS code from CBR ("Records" in the diagram), and taking LEFT 4, 6, 8 respectively to get:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SSCode.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/87290_SSCode.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I created three pivot tables. Since another requirement was to show all the values from the HSTx tables, regardless of whether there was a match in RECORDS, I used the fields "SSDesc" from the HSTx tables as my first dimension and selected "Show All Values" for it, then select the "HSTx.HSMatch" fields as the second dimension, and selected "Suppress If Null". for it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 12:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Associating-tables-on-variable-length-field-WITH-wildcards/m-p/829795#M292056</guid>
      <dc:creator />
      <dc:date>2015-05-22T12:59:18Z</dc:date>
    </item>
  </channel>
</rss>

