<?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 AW:Re: AW:Using a relative date where clause in a qvs script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167196#M38858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was shooting a little to fast.&lt;/P&gt;&lt;P&gt;So the where clause should be:&lt;/P&gt;&lt;P&gt;where (today() - RECORDOPENDATE) &amp;lt;=7&lt;/P&gt;&lt;P&gt;Just to explain: Assuming that RECORDOPENDATE can be interpreted as a valid calendar date, this comparison should calculate the difference of the system date and the recordopendate (in days). Examples:&lt;/P&gt;&lt;P&gt;2009.08.26 &amp;lt;today&amp;gt; - 2009.08.24 &amp;lt;RECORDOPENDATE&amp;gt;: 2 days (&amp;lt;=7 TRUE, so record should be loaded)&lt;BR /&gt;2009.08.26 &amp;lt;today&amp;gt; - 2009.08.14 &amp;lt;RECORDOPENDATE&amp;gt;: 12 days (&amp;lt;=7 FALSE, so record should be loaded)&lt;/P&gt;&lt;P&gt;If that doesn't work, might be you have to convert the RECORDOPENDATE with the date#-function; so if RECORDOPENDATE is e. g. '2009.08.24', you should use:&lt;/P&gt;&lt;P&gt;where (today() - date#(RECORDOPENDATE,'YYYY.MM.DD') &amp;lt;=7&lt;/P&gt;&lt;P&gt;Hope I made it clear and no mistake now ;-); but that actually should work.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2009 02:54:00 GMT</pubDate>
    <dc:creator>biester</dc:creator>
    <dc:date>2009-08-27T02:54:00Z</dc:date>
    <item>
      <title>Using a relative date where clause in a qvs script</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167193#M38855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to load data in my script but for only the last 7 days. Here is a section from my script where the central fact table is loaded via a qvd file but fails with the new where clause.&lt;/P&gt;&lt;P&gt;-----------------------&lt;/P&gt;&lt;P&gt;TrafficDetails:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD DATATRAFFICDETAILID,&lt;/P&gt;&lt;P&gt;CARRIERID,&lt;/P&gt;&lt;P&gt;RATEPLANID,&lt;/P&gt;&lt;P&gt;CARRIERGROUPID,&lt;/P&gt;&lt;P&gt;RECORDOPENTIME,&lt;/P&gt;&lt;P&gt;RECORDOPENDATE,&lt;/P&gt;&lt;P&gt;IMSI,&lt;/P&gt;&lt;P&gt;SGSNADDR,&lt;/P&gt;&lt;P&gt;ROUNDEDUSAGE,&lt;/P&gt;&lt;P&gt;CYCLEID,&lt;/P&gt;&lt;P&gt;CDRID,&lt;/P&gt;&lt;P&gt;if((ROUNDEDUSAGE = 0 OR IsNull(ROUNDEDUSAGE)), 'Y', 'N') as ZEROBYTE,&lt;/P&gt;&lt;P&gt;'D' AS BILLINGDATATYPE,&lt;/P&gt;&lt;P&gt;CAUSERECORDCLOSING,&lt;/P&gt;&lt;P&gt;RECORDSEQNUMBER,&lt;/P&gt;&lt;P&gt;DURATION,&lt;/P&gt;&lt;P&gt;GGSNADDR,&lt;/P&gt;&lt;P&gt;BYTESUPLINK,&lt;/P&gt;&lt;P&gt;BYTESDOWNLINK&lt;/P&gt;&lt;P&gt;FROM DataTrafficDetails.qvd (qvd)&lt;/P&gt;&lt;P&gt;where RECORDOPENDATE &amp;gt;= (GetDate() - 7);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------&lt;/P&gt;&lt;P&gt;What is the correct syntax?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 19:26:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167193#M38855</guid>
      <dc:creator />
      <dc:date>2009-08-26T19:26:50Z</dc:date>
    </item>
    <item>
      <title>AW:Using a relative date where clause in a qvs script</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167194#M38856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try with "today() -7" instead of GetDate.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 19:32:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167194#M38856</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-26T19:32:21Z</dc:date>
    </item>
    <item>
      <title>AW:Using a relative date where clause in a qvs script</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167195#M38857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joachim, but I am still having issues. Can you advise the full Syntax of the where clause line?&lt;/P&gt;&lt;P&gt;where RECORDOPENDATE &amp;gt;= (GetDate() - 7);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 21:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167195#M38857</guid>
      <dc:creator />
      <dc:date>2009-08-26T21:27:44Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Using a relative date where clause in a qvs script</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167196#M38858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was shooting a little to fast.&lt;/P&gt;&lt;P&gt;So the where clause should be:&lt;/P&gt;&lt;P&gt;where (today() - RECORDOPENDATE) &amp;lt;=7&lt;/P&gt;&lt;P&gt;Just to explain: Assuming that RECORDOPENDATE can be interpreted as a valid calendar date, this comparison should calculate the difference of the system date and the recordopendate (in days). Examples:&lt;/P&gt;&lt;P&gt;2009.08.26 &amp;lt;today&amp;gt; - 2009.08.24 &amp;lt;RECORDOPENDATE&amp;gt;: 2 days (&amp;lt;=7 TRUE, so record should be loaded)&lt;BR /&gt;2009.08.26 &amp;lt;today&amp;gt; - 2009.08.14 &amp;lt;RECORDOPENDATE&amp;gt;: 12 days (&amp;lt;=7 FALSE, so record should be loaded)&lt;/P&gt;&lt;P&gt;If that doesn't work, might be you have to convert the RECORDOPENDATE with the date#-function; so if RECORDOPENDATE is e. g. '2009.08.24', you should use:&lt;/P&gt;&lt;P&gt;where (today() - date#(RECORDOPENDATE,'YYYY.MM.DD') &amp;lt;=7&lt;/P&gt;&lt;P&gt;Hope I made it clear and no mistake now ;-); but that actually should work.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 02:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167196#M38858</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-27T02:54:00Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Using a relative date where clause in a qvs script</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167197#M38859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joachim, again thanks for your responses. I dod get the following to work (with a little help from Qliktech support &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;where num(date((RECORDOPENDATE) &amp;gt; (num(today() -7))));&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 18:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-relative-date-where-clause-in-a-qvs-script/m-p/167197#M38859</guid>
      <dc:creator />
      <dc:date>2009-08-28T18:30:55Z</dc:date>
    </item>
  </channel>
</rss>

