<?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 Loading data from table within date range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662619#M1068882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a main data table (Onderdelen) and a table (PPCO) like below.&lt;/P&gt;&lt;P&gt;I would like to add a field to Onderdelen named OND_JUR_PPCO and fill it with a 1 when the orderdate (OND_D_BESTEL) from Onderdelen lies between PPCO_INGANGSDATUM and PPCO_EINDDATUM from the PPCO table. The 2 tables share a key as shown below. Per matching key there can be more than one record in the PPCO table and therefore the daterange is neccesary to find the right record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So If the keys from both tables match and the orderdate lies between the date range then add OND_JUR_PPCO to Onderdelen with 1 or else with 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_OPDRGEVER &amp;amp; PPCO_MERKCODE &amp;amp; PPCO_SHB &amp;amp; PPCO_LEVERANCIER AS PPCO_KEY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_OPDRGEVER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_SHB, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_MERKCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_VOLGNR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_INGANGSDATUM, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_EINDDATUM,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_LEVERANCIER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I can add both of the dates from PPCO with a left join into the Onderdelen Table but then I have to reload this huge table again to perform the date request. There must be an easier way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx &lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Aug 2014 14:03:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-27T14:03:05Z</dc:date>
    <item>
      <title>Loading data from table within date range</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662619#M1068882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a main data table (Onderdelen) and a table (PPCO) like below.&lt;/P&gt;&lt;P&gt;I would like to add a field to Onderdelen named OND_JUR_PPCO and fill it with a 1 when the orderdate (OND_D_BESTEL) from Onderdelen lies between PPCO_INGANGSDATUM and PPCO_EINDDATUM from the PPCO table. The 2 tables share a key as shown below. Per matching key there can be more than one record in the PPCO table and therefore the daterange is neccesary to find the right record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So If the keys from both tables match and the orderdate lies between the date range then add OND_JUR_PPCO to Onderdelen with 1 or else with 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_OPDRGEVER &amp;amp; PPCO_MERKCODE &amp;amp; PPCO_SHB &amp;amp; PPCO_LEVERANCIER AS PPCO_KEY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_OPDRGEVER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_SHB, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_MERKCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_VOLGNR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_INGANGSDATUM, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_EINDDATUM,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PPCO_LEVERANCIER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I can add both of the dates from PPCO with a left join into the Onderdelen Table but then I have to reload this huge table again to perform the date request. There must be an easier way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx &lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 14:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662619#M1068882</guid>
      <dc:creator />
      <dc:date>2014-08-27T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from table within date range</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662620#M1068883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you need the PPCO table (that is the huge one, is it?) as such or is it only the start- and enddate that you need?&lt;/P&gt;&lt;P&gt;If it's the former and you do need the table as such - well, still loading RESIDENT from it just two fields should not pose an issue? You can join those to the other table and you can build an IF_construction to generate one new field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another, probably the more elegant solution, would be using IntervalMatch() in a LOAD statement - basically, with that you can find out if a date lies in the range of a start- and an end-date (among other possibilities).&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 14:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662620#M1068883</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-08-27T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from table within date range</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662621#M1068884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well the huge table is the Onderdelen table. From the PPCO table I need just one field together with the start and end date. I will try the intervalmatch wich you suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 14:22:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662621#M1068884</guid>
      <dc:creator />
      <dc:date>2014-08-27T14:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from table within date range</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662622#M1068885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to fix it with IntervalMatch but I can not get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added this to my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Intervalmatch:&lt;/P&gt;&lt;P&gt;IntervalMatch(OND_D_BESTEL)&lt;/P&gt;&lt;P&gt;LOAD Distinct PPCO_INGANGSDATUM, PPCO_EINDDATUM&lt;/P&gt;&lt;P&gt;Resident PPCO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This comes after the two tables are loaded and linked with the PPCO_KEY. The result is a synthetic key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the feeling that i could work now only I have to get it right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 15:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662622#M1068885</guid>
      <dc:creator />
      <dc:date>2014-08-27T15:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from table within date range</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662623#M1068886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved, I created a new table with all the dates in between the different ranges and then joined it with the lange data table. I used a loop function shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PPCO_JUR:&lt;/P&gt;&lt;P&gt;LOAD*,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PPCO_KEY_TMP &amp;amp; ' ' &amp;amp; ReferenceDate AS PPCO_KEY;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PPCO_KEY_TMP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; OND_JUR_PPCO,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; OND_JUR_PPCO_RECIPTOT,&lt;/P&gt;&lt;P&gt;Date(PPCO_INGANGSDATUM + IterNo() -1) AS ReferenceDate&lt;/P&gt;&lt;P&gt;Resident PPCO_JUR_TMP&lt;/P&gt;&lt;P&gt;While IterNo() &amp;lt;= PPCO_EINDDATUM - PPCO_INGANGSDATUM + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px;"&gt;Henric Cronström, Thanx for this document.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px;"&gt;Michel&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 12:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-data-from-table-within-date-range/m-p/662623#M1068886</guid>
      <dc:creator />
      <dc:date>2014-08-29T12:40:31Z</dc:date>
    </item>
  </channel>
</rss>

