<?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 Muliple Tables (Join Where) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187757#M51310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sally. That worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Mar 2010 15:10:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-26T15:10:12Z</dc:date>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187755#M51308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is how the data is setup:&lt;/P&gt;&lt;P&gt;Table 1 (OrderDate, Territory)&lt;BR /&gt;Table 2 (Territory, Staff, StartDate, EndDate)&lt;/P&gt;&lt;P&gt;I'm trying to pull in the staff into table one where the orderdate is within the startdate and enddate.&lt;/P&gt;&lt;P&gt;Any ideas on how to accomplish that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 20:32:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187755#M51308</guid>
      <dc:creator />
      <dc:date>2010-03-19T20:32:53Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187756#M51309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oy - beyond hokey, but this could work:&lt;/P&gt;&lt;P&gt;TEMPTable:&lt;BR /&gt;&lt;BR /&gt;load&lt;BR /&gt; OrderDate,&lt;BR /&gt; Territory&lt;BR /&gt;from table1&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN LOAD&lt;BR /&gt; Territory,&lt;BR /&gt; Staff,&lt;BR /&gt; StartDate,&lt;BR /&gt; EndDate&lt;BR /&gt;from table2;&lt;BR /&gt;&lt;BR /&gt;TEMPTable2:&lt;BR /&gt;LOAD&lt;BR /&gt; Territory,&lt;BR /&gt; Staff,&lt;BR /&gt; IF(OrderDate&amp;gt;=StartDate and OrderDate&amp;lt;=EndDate, OrderDate) as OrderDate&lt;BR /&gt;RESIDENT TEMPTable;&lt;BR /&gt;&lt;BR /&gt;FinalTable:&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT TEMPTAble2&lt;BR /&gt;WHERE NOT ISNULL(OrderDate);&lt;BR /&gt;&lt;BR /&gt;DROP TABLE TEMPTable;&lt;BR /&gt;DROP TABLE TEMPTable2;&lt;/P&gt;&lt;P&gt;There must be a more elegant way to do it. I hate dealing with that many temp tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 21:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187756#M51309</guid>
      <dc:creator />
      <dc:date>2010-03-19T21:09:55Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187757#M51310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sally. That worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 15:10:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187757#M51310</guid>
      <dc:creator />
      <dc:date>2010-03-26T15:10:12Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187758#M51311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this (untested):&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LEFT JOIN ([Table 1])&lt;BR /&gt;INTERVALMATCH (OrderDate,Territory)&lt;BR /&gt;LOAD&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;,Territory&lt;BR /&gt;RESIDENT [Table 2]&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN ([Table 1])&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT [Table 2]&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE&lt;BR /&gt; [Table 2]&lt;BR /&gt;;&lt;BR /&gt;DROP FIELDS&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Even if that's not exactly it, I think that's the basic idea. You use intervalmatch to match up the order date and territory to the start and end dates by territory. The first left join should, I think, put the start and end date on Table 1. At that point you have territory, start date and end date on table 1, so one more left join gets you the staff. After that, I assume you no longer need table 2 or the start and end dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 21:24:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187758#M51311</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-03-26T21:24:49Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187759#M51312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with John's method.&lt;/P&gt;&lt;P&gt;But perhaps you should add DISTINCT in this place:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;LEFT JOIN ([Table 1])&lt;BR /&gt;INTERVALMATCH (OrderDate,Territory)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;,Territory&lt;BR /&gt;RESIDENT [Table 2]&lt;BR /&gt;;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That way a each combination of Territory, StartDate and EndDate is unique. If each value in field Staff can only have one combination of those three fields, you don't need the DISTINCT of course.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 22:43:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187759#M51312</guid>
      <dc:creator />
      <dc:date>2010-03-26T22:43:16Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187760#M51313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aha. I knew there had to be a more elegant way of doing it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 14:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187760#M51313</guid>
      <dc:creator />
      <dc:date>2010-03-29T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Muliple Tables (Join Where)</title>
      <link>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187761#M51314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys. I'll give this method a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 14:41:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Muliple-Tables-Join-Where/m-p/187761#M51314</guid>
      <dc:creator />
      <dc:date>2010-03-29T14:41:45Z</dc:date>
    </item>
  </channel>
</rss>

