<?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: Limit Data Loading based on most recent date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2027268#M1222241</link>
    <description>&lt;P&gt;Hello Maxgro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One question about this solution. After implementation I noticed that the key fields for rows with dates outside of the date range are still populated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for example a row that originally had a date outside the cutoff range no longer has any information in it except for the ID numbers. How do I get rid of those?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clstuart_0-1674057666761.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98315i4F333AEE155A3CD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clstuart_0-1674057666761.png" alt="clstuart_0-1674057666761.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 16:01:13 GMT</pubDate>
    <dc:creator>clstuart</dc:creator>
    <dc:date>2023-01-18T16:01:13Z</dc:date>
    <item>
      <title>Limit Data Loading based on most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2024598#M1222163</link>
      <description>&lt;P&gt;I am attempting to limit the data loaded by a particular table. My limitation is that I only wish to pull the data starting 3 years prior to the most recent date from the table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am currently trying to use the Where statement upon loading the table, it looks like this&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Where year(myDate) &amp;gt;= year(Max(myDate))-3;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This returns "aggregation functions are not allowed here".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I used a "let" statement to load the data from 3 years prior to today(), but I'm not sure how to scope it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where can I place a "let startYear =&amp;nbsp;year(Max(myDate))-3;" so the myDate will be in scope and startYear will also be in scope for the Where?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 20:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2024598#M1222163</guid>
      <dc:creator>clstuart</dc:creator>
      <dc:date>2023-01-11T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Data Loading based on most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2024604#M1222164</link>
      <description>&lt;P&gt;&lt;EM&gt;If the table with the dates is A&lt;/EM&gt;&lt;BR /&gt;A:&lt;BR /&gt;load&lt;BR /&gt;DATE(MAKEDATE(2020) + FLOOR(rand()*4000)) as Date&lt;BR /&gt;AutoGenerate 10000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Set&amp;nbsp; a variable with the max year from A&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;M:&lt;BR /&gt;LOAD YEAR(MAX(Date))-3 as MaxYear Resident A;&lt;/P&gt;
&lt;P&gt;LET vStartYear = PEEK('MaxYear');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Filter the table A with the variable&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;AA:&lt;BR /&gt;NOCONCATENATE LOAD * RESIDENT A WHERE Year(Date) &amp;gt;= $(vStartYear);&lt;/P&gt;
&lt;P&gt;DROP TABLE A;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 21:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2024604#M1222164</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2023-01-11T21:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Data Loading based on most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2026142#M1222202</link>
      <description>&lt;P&gt;Thank you, this worked.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 12:18:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2026142#M1222202</guid>
      <dc:creator>clstuart</dc:creator>
      <dc:date>2023-01-16T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Data Loading based on most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2027268#M1222241</link>
      <description>&lt;P&gt;Hello Maxgro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One question about this solution. After implementation I noticed that the key fields for rows with dates outside of the date range are still populated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for example a row that originally had a date outside the cutoff range no longer has any information in it except for the ID numbers. How do I get rid of those?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clstuart_0-1674057666761.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98315i4F333AEE155A3CD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clstuart_0-1674057666761.png" alt="clstuart_0-1674057666761.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 16:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limit-Data-Loading-based-on-most-recent-date/m-p/2027268#M1222241</guid>
      <dc:creator>clstuart</dc:creator>
      <dc:date>2023-01-18T16:01:13Z</dc:date>
    </item>
  </channel>
</rss>

