<?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: WHERE in JOIN when loading in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444733#M165865</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2012 09:29:34 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-11-19T09:29:34Z</dc:date>
    <item>
      <title>WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444731#M165863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if it is possible to put a condition on the a join when adding 1 table to another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What needs to happen is that I have 1 table with start &amp;amp; end dates with a speciffic price. &lt;/P&gt;&lt;P&gt;So with my join, when the date is in a speciffic range it needs to join the price from that range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way i understand QV does an automattic join if the colum names are the same. So just joining on product doesn't give the correct results.&lt;/P&gt;&lt;P&gt;And when i try to join where date &amp;gt; start and &amp;lt; end, then I get an error that Table1.date doesn't exist in Table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simple example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales table:&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="68" style="width: 161px; border: 1px solid rgb(0, 0, 0); height: 58px;"&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;Product&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;Sell Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;02/02/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;10/10/2012&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;Pricing table:&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="68" style="width: 220px; border: 1px solid #000000; height: 62px;" width="237"&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;Product&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;Start Date&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;End Date&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;Price&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;01/01/2012&lt;/TD&gt;&lt;TD&gt;30/06/2012&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;01/07/2012&lt;/TD&gt;&lt;TD&gt;31/12/2012&lt;/TD&gt;&lt;TD&gt;25.00&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;So after the JOIN, i need the table to look like this:&lt;/P&gt;&lt;P&gt;Combined:&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="68" style="width: 245px; border: 1px solid #000000; height: 49px;" width="243"&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;Product&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;Sell Date&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; text-align: -webkit-center; background-color: #6690bc;"&gt;Sell Price&lt;/STRONG&gt; &lt;BR /&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;02/02/2012&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Coke&lt;/TD&gt;&lt;TD&gt;10/10/2012&lt;/TD&gt;&lt;TD&gt;25.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 09:18:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444731#M165863</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-19T09:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444732#M165864</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;For this requirement you should look at using the Intervalmatch() function in QlikView. It does exactly what you need, i.e. match a value within an interval.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 09:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444732#M165864</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-19T09:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444733#M165865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 09:29:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444733#M165865</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-19T09:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444734#M165866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx. This does seem like the function i require.&lt;/P&gt;&lt;P&gt;However, what happens is there for instance isn't an end date? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like for instance the price says like that forever?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 13:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444734#M165866</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-19T13:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444735#M165867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that the interval will be ignored.&lt;/P&gt;&lt;P&gt;In such cases you should put in a fictional max date like 31-12-2099 - that way making sure the interval is always closed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 13:36:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444735#M165867</guid>
      <dc:creator>jfkinspari</dc:creator>
      <dc:date>2012-11-19T13:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in JOIN when loading</title>
      <link>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444736#M165868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok i have tested this solution, but it doesn't seem to be working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First i tried to adapt the same code to my enviroment, but i get NO results in the tables actually linking&lt;/P&gt;&lt;P&gt;-------------------------------------------&lt;/P&gt;&lt;P&gt;Left join (Timesheet1)&lt;/P&gt;&lt;P&gt;IntervalMatch(TS_NewDate2)&lt;/P&gt;&lt;P&gt;load Distinct [SLA_Start1],[SLA_End1]&lt;/P&gt;&lt;P&gt;Resident Projects;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left join load * Resident Projects;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Fields [SLA_Start1],[SLA_End1];&lt;/P&gt;&lt;P&gt;Drop table Projects;&lt;/P&gt;&lt;P&gt;------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the code to add the date() function on line 3 like this - &lt;/P&gt;&lt;P&gt;load Distinct date([SLA_Start1]),date([SLA_End1])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gives me results, but then against all lines, and not only where it is supposed to be applicable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 11:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WHERE-in-JOIN-when-loading/m-p/444736#M165868</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-21T11:33:23Z</dc:date>
    </item>
  </channel>
</rss>

