<?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 Scripting: Left join with criteria in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503367#M694002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to left join to a table and only show the records from the Product table that meet the criteria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Active_Date &amp;gt;= Effective_Date and Active_Date&amp;lt;Term_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struggling with the getting the proper code/syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example code withouth the above crtieria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_1:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;Product ,&lt;/P&gt;&lt;P&gt;Active_Date&lt;/P&gt;&lt;P&gt;Resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Table_1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Product, &lt;/P&gt;&lt;P&gt;Type_Flag,&lt;/P&gt;&lt;P&gt;Effective_Date, &lt;/P&gt;&lt;P&gt;Term_Date&lt;/P&gt;&lt;P&gt;Resident Product;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jun 2013 17:12:46 GMT</pubDate>
    <dc:creator>zagzebski</dc:creator>
    <dc:date>2013-06-24T17:12:46Z</dc:date>
    <item>
      <title>Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503367#M694002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to left join to a table and only show the records from the Product table that meet the criteria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Active_Date &amp;gt;= Effective_Date and Active_Date&amp;lt;Term_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struggling with the getting the proper code/syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example code withouth the above crtieria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_1:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;Product ,&lt;/P&gt;&lt;P&gt;Active_Date&lt;/P&gt;&lt;P&gt;Resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Table_1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Product, &lt;/P&gt;&lt;P&gt;Type_Flag,&lt;/P&gt;&lt;P&gt;Effective_Date, &lt;/P&gt;&lt;P&gt;Term_Date&lt;/P&gt;&lt;P&gt;Resident Product;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 17:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503367#M694002</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-06-24T17:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503368#M694003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll have to do the join first and then filter the records with a where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Product ,&lt;/P&gt;&lt;P&gt;Active_Date&lt;/P&gt;&lt;P&gt;Resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (Table_1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Product,&lt;/P&gt;&lt;P&gt;Type_Flag,&lt;/P&gt;&lt;P&gt;Effective_Date,&lt;/P&gt;&lt;P&gt;Term_Date&lt;/P&gt;&lt;P&gt;Resident Product;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;noconcatenate&lt;/P&gt;&lt;P&gt;load * resident Table_1&lt;/P&gt;&lt;P&gt;where Active_Date &amp;gt;= Effective_Date and Active_Date&amp;lt;Term_Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Table_1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure the date fields are all real dates and not strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also try to use the intervalmatch function. See this blog post: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch" style="font-size: 12px; color: #252525;"&gt;IntervalMatch&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 17:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503368#M694003</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-24T17:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503369#M694004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date fields are screwing me up&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effective data and term date are in this format (ex 20101031)&amp;nbsp; while the service date is a number (ex. 40369)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always struggle knowing the formats and getting them into the same format for evaluation purposes. Any expertise you can provide?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 17:52:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503369#M694004</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-06-24T17:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503370#M694005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for date field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex : 20101031 use this expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;makedate(left(20101031,4),mid(20101031,5,2),right(20101031,2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex: 40369 use date(40369)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HOPE IT HELPS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 19:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503370#M694005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-24T19:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503371#M694006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes this did help - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it best in situations like this to get it back to a date field or try to convert to a number if there is a need to compare these fields?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 19:21:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503371#M694006</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-06-24T19:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting: Left join with criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503372#M694007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it really depend on the script.........&lt;/P&gt;&lt;P&gt;i usally&amp;nbsp; change everything into number format like '40369' and in the front end at chart &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use date in number tab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 19:42:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-Left-join-with-criteria/m-p/503372#M694007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-24T19:42:57Z</dc:date>
    </item>
  </channel>
</rss>

