<?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: Limiting Load data to past 5 years in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Limiting-Load-data-to-past-5-years/m-p/1617234#M594977</link>
    <description>&lt;P&gt;Those are SQL functions that should be on the SQL SELECT part for each table. For that you will need to check the correct syntax for your RDBMS and driver.&lt;/P&gt;
&lt;P&gt;You can also do it on the LOAD part of the script for each table using something like&lt;/P&gt;
&lt;P&gt;WHERE YearNBR &amp;gt;= AddYears(Today(), -5)&lt;/P&gt;
&lt;P&gt;AND DateDT &amp;lt;= Today();&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;WHERE Date &amp;lt;= Today();&lt;/P&gt;
&lt;P&gt;For that, you need to make sure that the values in the fields "Date", "DateDT" and the value of Today() have the same format, for example, for Spain: "DD/MM/YYYY" else the comparison will fail.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2019 16:40:23 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2019-08-27T16:40:23Z</dc:date>
    <item>
      <title>Limiting Load data to past 5 years</title>
      <link>https://community.qlik.com/t5/QlikView/Limiting-Load-data-to-past-5-years/m-p/1617190#M594976</link>
      <description>&lt;P&gt;Hi Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to limit the amount of data brought into an application? I am currently trying to limit the data to the current years data and the past 5 years. I put the following function into my calendar entity:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE YearNBR &amp;gt;= DATEPART(YY,GETDATE())-5&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AND DateDT &amp;lt;=GetDate()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It works for my Calendar table, but it isn't following through into any of my other tables. My other tables are using the following to limit the data:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE Date &amp;lt; cast(getdate() as date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I wasn't the one who created the application, but I am trying to update it to only include 5 historical years of data and am unable to figure out why not all of the dates are being filtered out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate the help!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Rose&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 15:31:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limiting-Load-data-to-past-5-years/m-p/1617190#M594976</guid>
      <dc:creator>rtr13</dc:creator>
      <dc:date>2019-08-27T15:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Limiting Load data to past 5 years</title>
      <link>https://community.qlik.com/t5/QlikView/Limiting-Load-data-to-past-5-years/m-p/1617234#M594977</link>
      <description>&lt;P&gt;Those are SQL functions that should be on the SQL SELECT part for each table. For that you will need to check the correct syntax for your RDBMS and driver.&lt;/P&gt;
&lt;P&gt;You can also do it on the LOAD part of the script for each table using something like&lt;/P&gt;
&lt;P&gt;WHERE YearNBR &amp;gt;= AddYears(Today(), -5)&lt;/P&gt;
&lt;P&gt;AND DateDT &amp;lt;= Today();&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;WHERE Date &amp;lt;= Today();&lt;/P&gt;
&lt;P&gt;For that, you need to make sure that the values in the fields "Date", "DateDT" and the value of Today() have the same format, for example, for Spain: "DD/MM/YYYY" else the comparison will fail.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 16:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Limiting-Load-data-to-past-5-years/m-p/1617234#M594977</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2019-08-27T16:40:23Z</dc:date>
    </item>
  </channel>
</rss>

