<?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: How to ignore rows after a certain date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748711#M1039935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this way while you create the variable from this variable (YEAR($(currentDate)) - 1) and create Year then subtract 1 it will not allow and give random values you have to try this ways &lt;STRONG&gt;Year(currentDate)-1&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Set the current date&lt;/P&gt;&lt;P&gt;LET currentDate = Date(Today());&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vPreviousYear= Year(currentDate)-1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Load the table with the 'WHERE' clause from the spreadsheet&lt;/P&gt;&lt;P&gt;LamDemandAndCapacity:&lt;/P&gt;&lt;P&gt;LOAD Whse as %WhseId, &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Dt],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This column is formatted as mm/d/yyyy&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE YEAR( [Production Dt]) &amp;gt; &lt;STRONG&gt;$(vPreviousYear);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Dec 2014 20:47:54 GMT</pubDate>
    <dc:creator>its_anandrjs</dc:creator>
    <dc:date>2014-12-16T20:47:54Z</dc:date>
    <item>
      <title>How to ignore rows after a certain date</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748709#M1039933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm relatively new to Qlikview.&amp;nbsp; One of the issues I am currently stumped by is that we have a load from an excel spreadsheet.&amp;nbsp; Some of the data is irrelevant because it has a "Production Dt" in the 1950s.&amp;nbsp; In SQL, I would just say "SELECT * FROM SomeTable s WHERE YEAR(s.ProductionDt) &amp;gt; YEAR(GETDATE()) -1.&amp;nbsp; However, I have tried to do something similar in Qlikview to no avail.&amp;nbsp; Thus far I've tried &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Set the current date&lt;/P&gt;&lt;P&gt;LET currentDate = Date(Today());&lt;/P&gt;&lt;P&gt;//Load the table with the 'WHERE' clause from the spreadsheet&lt;/P&gt;&lt;P&gt;LamDemandAndCapacity:&lt;/P&gt;&lt;P&gt;LOAD Whse as %WhseId, &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Dt],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This column is formatted as mm/d/yyyy&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE YEAR( [Production Dt]) &amp;gt; (YEAR($(currentDate)) - 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; However, when I run the following code below, the MinDate is always the same day in 1949,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MinMaxDate:&lt;/P&gt;&lt;P&gt;Load Min([Production Dt]) as MinDate, Max([Production Dt]) as MaxDate resident LamDemandAndCapacity;&lt;/P&gt;&lt;P&gt;Let vMinDate = Peek('MinDate',-1,'MinMaxDate') - 1;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate',-1,'MinMaxDate');&lt;/P&gt;&lt;P&gt;LET vDumbDate = Date($(vMinDate));&lt;/P&gt;&lt;P&gt;LET vCurrentYear = Year($(currentDate));\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace 'Min Date' $(vDumbDate);&amp;nbsp;&amp;nbsp; &amp;lt;----12/29/1949&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this subject is GREATLY appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 20:15:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748709#M1039933</guid>
      <dc:creator>JustinDallas</dc:creator>
      <dc:date>2014-12-16T20:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore rows after a certain date</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748710#M1039934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, change just the first line.&lt;/P&gt;&lt;P&gt;Use SET currentDate =Today();&lt;/P&gt;&lt;P&gt;Then expression YEAR($(currentDate))&amp;nbsp; returns proper result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you could use:&lt;/P&gt;&lt;P&gt;LET currentDate =Today();&lt;/P&gt;&lt;P&gt;And later use YEAR(currentDate), without the $ notation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 20:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748710#M1039934</guid>
      <dc:creator />
      <dc:date>2014-12-16T20:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore rows after a certain date</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748711#M1039935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this way while you create the variable from this variable (YEAR($(currentDate)) - 1) and create Year then subtract 1 it will not allow and give random values you have to try this ways &lt;STRONG&gt;Year(currentDate)-1&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Set the current date&lt;/P&gt;&lt;P&gt;LET currentDate = Date(Today());&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vPreviousYear= Year(currentDate)-1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Load the table with the 'WHERE' clause from the spreadsheet&lt;/P&gt;&lt;P&gt;LamDemandAndCapacity:&lt;/P&gt;&lt;P&gt;LOAD Whse as %WhseId, &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Dt],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This column is formatted as mm/d/yyyy&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE YEAR( [Production Dt]) &amp;gt; &lt;STRONG&gt;$(vPreviousYear);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 20:47:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748711#M1039935</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-12-16T20:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore rows after a certain date</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748712#M1039936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, looks like I need to take myself to the library and read about the differences between SET and LET, and what the $ actually does.&amp;nbsp; For reference, my ending solution looked like so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET currentDate = Today();&lt;/STRONG&gt;&amp;nbsp; &amp;lt;---Big Difference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LamDemandAndCapacity:&lt;/P&gt;&lt;P&gt;LOAD Whse as %WhseId, &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Dt],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sum of Total Length (ft)]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE YEAR( [Production Dt]) &amp;gt; (YEAR($(currentDate)) - 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MinMaxDate:&lt;/P&gt;&lt;P&gt;Load Min([Production Dt]) as MinDate, Max([Production Dt]) as MaxDate resident LamDemandAndCapacity;&lt;/P&gt;&lt;P&gt;Let vMinDate = Peek('MinDate',-1,'MinMaxDate') - 1;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate',-1,'MinMaxDate');&lt;/P&gt;&lt;P&gt;LET vDumbDate =&amp;nbsp; Date($(vMinDate));&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;trace 'Min Date' $(vDumbDate);//&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &amp;lt;----12/29/1949&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 20:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748712#M1039936</guid>
      <dc:creator>JustinDallas</dc:creator>
      <dc:date>2014-12-16T20:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore rows after a certain date</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748713#M1039937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you are right when use SET it is static and saved as string and value not calculated and when you use Let it will manipulated the function. Did you check my answer also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 21:02:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-ignore-rows-after-a-certain-date/m-p/748713#M1039937</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-12-16T21:02:32Z</dc:date>
    </item>
  </channel>
</rss>

