<?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 RESIDENT and LEFT JOIN in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190030#M52680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try to connect on your database then run the same sql statement ?&lt;/P&gt;&lt;P&gt;Such as&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;a.*,&lt;BR /&gt;b.CA as CA_N_1_JaJ,&lt;BR /&gt;b.Nb_Client as Nb_Client_N_1_JaJ&lt;BR /&gt;from&lt;BR /&gt;Table1 a&lt;BR /&gt;left join&lt;BR /&gt;Table1 b&lt;BR /&gt;on (a.Code_Client = b.Code_Client&lt;BR /&gt;and a.Temps_Jour_Nom = b.Temps_Jour_Nom&lt;BR /&gt;and (b.ChampDate between a.ChampDate - 370 and a.ChampDate- 360)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Nov 2010 17:45:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-16T17:45:42Z</dc:date>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190029#M52679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everydody;&lt;/P&gt;&lt;P&gt;I have a good SQL script but I don't arrive to translate it in qlikview.&lt;/P&gt;&lt;P&gt;This is my sql&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;a.*,&lt;BR /&gt;b.CA as CA_N_1_JaJ,&lt;BR /&gt;b.Nb_Client as Nb_Client_N_1_JaJ&lt;BR /&gt;from&lt;BR /&gt;Table1 a&lt;BR /&gt;left join&lt;BR /&gt;Table1 b&lt;BR /&gt;on (a.Code_Client = b.Code_Client&lt;BR /&gt;and a.Temps_Jour_Nom = b.Temps_Jour_Nom&lt;BR /&gt;and (b.ChampDate between a.ChampDate - 370 and a.ChampDate- 360)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I've tried with RESIDENT and LEFT JOIN but I'm not arrived to OK result.&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;Think you for tour help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 17:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190029#M52679</guid>
      <dc:creator />
      <dc:date>2010-11-16T17:27:52Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190030#M52680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try to connect on your database then run the same sql statement ?&lt;/P&gt;&lt;P&gt;Such as&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;a.*,&lt;BR /&gt;b.CA as CA_N_1_JaJ,&lt;BR /&gt;b.Nb_Client as Nb_Client_N_1_JaJ&lt;BR /&gt;from&lt;BR /&gt;Table1 a&lt;BR /&gt;left join&lt;BR /&gt;Table1 b&lt;BR /&gt;on (a.Code_Client = b.Code_Client&lt;BR /&gt;and a.Temps_Jour_Nom = b.Temps_Jour_Nom&lt;BR /&gt;and (b.ChampDate between a.ChampDate - 370 and a.ChampDate- 360)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 17:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190030#M52680</guid>
      <dc:creator />
      <dc:date>2010-11-16T17:45:42Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190031#M52681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sorry for this but I have a simpe question whcih is related to this...&lt;/P&gt;&lt;P&gt;When I do a left join between 2 resident tables, is there a way I can add the condition as we do in SQL ..&lt;/P&gt;&lt;P&gt;ex..Left join on a.fieldsname=b.fieldname?&lt;/P&gt;&lt;P&gt;Or does qlikview do it automatically based on column names?&lt;/P&gt;&lt;P&gt;I ahve a requirement to join 2 resident tables based on 3 conditions.&lt;/P&gt;&lt;P&gt;Thanks a lot!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 18:32:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190031#M52681</guid>
      <dc:creator>parpatra</dc:creator>
      <dc:date>2010-11-16T18:32:35Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190032#M52682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The QlikView Join is done solely based on common column names. There is usually no problem with this since you just change the names of the columns in order to perform the join properly.&lt;/P&gt;&lt;P&gt;As Sébastien posted, it is easier to directly use SQL that is already working properly, but if you want to do something similiar in QlikView to the SQL posted by Lna you are going to have to use the Intervalmatch() function because one of the conditions is a range.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;Table1:&lt;BR /&gt;LOAD *, ChampDate as ChampDate_From, ChampDate as ChampDate_To;&lt;BR /&gt;SQL Select *&lt;BR /&gt;From Table1;&lt;/P&gt;&lt;P&gt;Drop field ChampDate from Table1;&lt;/P&gt;&lt;P&gt;Table2:&lt;BR /&gt;LOAD Code_Client,&lt;BR /&gt; Temps_Jour_Nom,&lt;BR /&gt; ChampDate ,&lt;BR /&gt; CA as CA_N_1_JaJ,&lt;BR /&gt; Nb_Client as Nb_Client_N_1_JaJ;&lt;BR /&gt;SQL Select Code_Client,Temps_Jour_Nom,ChampDate,CA,Nb_Client&lt;BR /&gt;From Table2;&lt;BR /&gt;Inner Join&lt;BR /&gt;IntervalMatch ( ChampDate ,Code_Client,Temps_Jour_Nom) Load ChampDate_From, ChampDate_To, Code_Client,Temps_Jour_Nom Resident Table1;&lt;/P&gt;&lt;P&gt;Left Join (Table1)&lt;BR /&gt;Load *&lt;BR /&gt;Resident Table2;&lt;/P&gt;&lt;P&gt;Drop Table Table1;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 22:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190032#M52682</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-16T22:09:57Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190033#M52683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(Bah, beaten to it. Ah, well. I'm posting anyway. &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt; That we basically have the same solution makes me more confident in it, at least.)&lt;/P&gt;&lt;P&gt;QlikView does it automatically based on column names. You can add conditions, but they're conditions on the load of the second table, not strictly conditions on the join itself, so you can't (for instance) reference the table you're joining to.&lt;/P&gt;&lt;P&gt;And this, of course, explains why we can't do this left join as simply as we would be able to in SQL. Instead, I believe we would create new fields for the date range, and then intervalmatch to that date range. Untested, but perhaps like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;MyTable:&lt;BR /&gt;LOAD *&lt;BR /&gt;,date(ChampDate-370) as FromDate&lt;BR /&gt;,date(ChampDate-360) as ToDate&lt;BR /&gt;;&lt;BR /&gt;SQL&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM Table1&lt;BR /&gt;;&lt;BR /&gt;B:&lt;BR /&gt;LOAD&lt;BR /&gt; Code_Client&lt;BR /&gt;,Temps_Jour_Nom&lt;BR /&gt;,ChampDate as BChampDate&lt;BR /&gt;,CA as CA_N_1_JaJ&lt;BR /&gt;,Nb_Client as Nb_Client_N_1_JaJ&lt;BR /&gt;RESIDENT MyTable&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN (MyTable)&lt;BR /&gt;INTERVALMATCH (BChampDate, Code_Client, Temps_Jour_Nom)&lt;BR /&gt;LOAD FromDate, ToDate, Code_Client, Temps_Jour_Nom&lt;BR /&gt;RESIDENT B&lt;BR /&gt;;&lt;BR /&gt;DROP FIELDS&lt;BR /&gt; BChampDate&lt;BR /&gt;,FromDate&lt;BR /&gt;,ToDate&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 22:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190033#M52683</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-11-16T22:17:32Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190034#M52684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Thank you for all your responses but I'm tried all the day and I'm not arrived to have a good results!&lt;/P&gt;&lt;P&gt;Have you any idea?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 17:03:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190034#M52684</guid>
      <dc:creator />
      <dc:date>2010-11-17T17:03:57Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190035#M52685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What problem or error are you experiencing?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 17:07:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190035#M52685</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-17T17:07:08Z</dc:date>
    </item>
    <item>
      <title>RESIDENT and LEFT JOIN</title>
      <link>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190036#M52686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everybody, Finally, my last test is ok!&lt;/P&gt;&lt;P&gt;you have help me! very good!&lt;/P&gt;&lt;P&gt;i'm thank you for your help!&lt;/P&gt;&lt;P&gt;have a good day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 09:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RESIDENT-and-LEFT-JOIN/m-p/190036#M52686</guid>
      <dc:creator />
      <dc:date>2010-11-18T09:34:32Z</dc:date>
    </item>
  </channel>
</rss>

