<?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: Filter table with date greater than within script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937938#M949687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sarah, try with this variable value:&lt;/P&gt;&lt;P&gt;Let v3MonthsAgoToday = Num(AddMonths(Date(Today()),-3));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If doesn't works use the variable in where like:&lt;/P&gt;&lt;P&gt;WHERE Audit_Timestamp &amp;gt;= $(v3MonthsAgoToday);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2015 10:19:47 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2015-12-16T10:19:47Z</dc:date>
    <item>
      <title>Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937937#M949686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to load the past three months data from a QVD file, however I can't get my WHERE clause to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let v3MonthsAgoToday = AddMonths(Date(Today()),-3);&lt;/P&gt;&lt;P&gt;LOAD Audit_Id, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Audit_Timestamp) AS Audit_Timestamp, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Application_Audit.QVD (qvd)&lt;/P&gt;&lt;P&gt;WHERE Audit_Timestamp &amp;gt;= v3MonthsAgoToday;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried surrounding both &lt;SPAN style="font-size: 13.3333px;"&gt;v3MonthsAgoToday and &lt;SPAN style="font-size: 13.3333px;"&gt;Audit_Timestamp with Date(), Date#() and &lt;/SPAN&gt;&lt;/SPAN&gt;Date(&lt;SPAN style="font-size: 13.3333px;"&gt;[field/variable], 'dd-mm-yyyy') but none of these work.&amp;nbsp; The only thing that works is WHERE Audit_Timestamp &amp;gt;=&amp;nbsp; 42263, however I need this date to change relative to today's date.&amp;nbsp; I'd rather get rid of the &lt;SPAN style="font-size: 13.3333px;"&gt;v3MonthsAgoToday variable if possible too.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any responses much appreciated, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 09:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937937#M949686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-16T09:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937938#M949687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sarah, try with this variable value:&lt;/P&gt;&lt;P&gt;Let v3MonthsAgoToday = Num(AddMonths(Date(Today()),-3));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If doesn't works use the variable in where like:&lt;/P&gt;&lt;P&gt;WHERE Audit_Timestamp &amp;gt;= $(v3MonthsAgoToday);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937938#M949687</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-12-16T10:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937939#M949688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answer above should work if the field in your where clause is formatted as a number and the variable is in date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if this doesn't fix your issue could you post an simple app example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937939#M949688</guid>
      <dc:creator />
      <dc:date>2015-12-16T10:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937940#M949689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Ruben, I knew it would be something simple!&amp;nbsp; Adding num() to the variable fixed it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:28:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937940#M949689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-16T10:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937941#M949690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let v3MonthsAgoToday = date(AddMonths(Today(),-3),'DD/MMM/YYYY');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Audit_Id,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Audit_Timestamp,'DD/MMM/YYYY') AS Audit_Timestamp,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Application_Audit.QVD (qvd)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE Audit_Timestamp &amp;gt;= '$(v3MonthsAgoToday)';&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this will work!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937941#M949690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-16T10:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table with date greater than within script</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937942#M949691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, a date from qvd is also a number, so filter as number works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution provided by Balraj also should work. Setting the date in the where clause between simple quotes keeps the string, without the simple quotes QV tries to resolve as a math operation making a division (with '/' as separator xx/xx/xxxx) or the difference (with '-' as separator xx-xx-xxxx).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 10:45:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-table-with-date-greater-than-within-script/m-p/937942#M949691</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-12-16T10:45:14Z</dc:date>
    </item>
  </channel>
</rss>

