<?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 Using today() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304582#M1200304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johan,&lt;/P&gt;&lt;P&gt;That WHERE statement is correct and it should work if the function Date() is evaluated properly. The following code works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;RawData:LOAD Date(Date('01/01/2010') + Rand() * 730, 'YYYYMMDD') AS DateAUTOGENERATE 2000; // Just dummy data to compare with ValidData:LOAD *, RecNo() AS Dummy // Another field to not concatenate with previous tableRESIDENT RawDataWHERE Date &amp;lt; Date(Today(), 'YYYYMMDD'); // Here the date is being evaluated correctly DROP TABLE RawData;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In the example above, "Date" field as an actual date field (so numeric) and that allows not to quote the function. So to properly evaluate the date when it's a string and passed as valid value for a field, it would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vToday = Date(Today(), 'YYYYMMDD'); RawData:LOAD Text(Date(Date('01/01/2010') + Rand() * 730, 'YYYYMMDD')) AS DateAUTOGENERATE 2000; ValidData:LOAD *, RecNo() AS DummyRESIDENT RawDataWHERE Date &amp;lt; '$(vToday)'; DROP TABLE RawData;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Feb 2011 22:50:52 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-02-09T22:50:52Z</dc:date>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304572#M1200294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am joining two tables using "left join load…" which works good.&lt;BR /&gt;I then want to filter out certain rows that are old using a "where" statement but&lt;BR /&gt;I keep getting different results using the following code:&lt;/P&gt;&lt;P&gt;&lt;B&gt;where&lt;/B&gt; date_t &amp;gt;= Date#(Today(), 'yyyymmdd') OR date_t = ''&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;B&gt;where&lt;/B&gt; date_t &amp;gt;= '20110208' OR date_t =''&lt;/P&gt;&lt;P&gt;…why is this? I don't understand.&lt;BR /&gt;Shouldn't I get the same results? Doesn't today() actually mean today?&lt;BR /&gt;Using today() I also get rows with dates from January (30&lt;SUP&gt;th&lt;/SUP&gt;, 23&lt;SUP&gt;rd&lt;/SUP&gt;, 9&lt;SUP&gt;th&lt;/SUP&gt;…)..I only expect to get rows from Feb 8&lt;SUP&gt;th&lt;/SUP&gt; and later (which I do get if I enter the real date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My tables look like this:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;EMP:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;@2 as id_nr,&lt;/P&gt;&lt;P&gt;@4 as date_f,&lt;/P&gt;&lt;P&gt;@5 as date_t&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;emp.txt(txt, codepage is 1252, no labels, delimiter is '|', msq, header is 8 lines)where @5&amp;gt;='20110208' OR @5='';&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;//where @5 &amp;gt;= Date#(Today(1), 'yyyymmdd') OR @5 = '';&lt;/P&gt;&lt;P&gt;//where @5&amp;gt;='20110208' OR @5='';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN &lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;@2 as id_nr,&lt;/P&gt;&lt;P&gt;@3 as last_name,&lt;/P&gt;&lt;P&gt;@4 as first_name&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;pers.txt(txt, codepage is 1252, no labels, delimiter is '|', msq, header is 8 lines);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really want to avoid having to "hard code" a date in my script.&lt;/P&gt;&lt;P&gt;Any help appreciated.[:D]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 14:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304572#M1200294</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-02-08T14:13:14Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304573#M1200295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johan,&lt;/P&gt;&lt;P&gt;At a first glance, I'd say you need to quote the date function to get it working since you are passing a string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vLoadDate = Date#(Today(1), 'YYYYMMDD'); EMP:LOAD@2 as id_nr,@4 as date_f,@5 as date_t..FROMemp.txt(txt, codepage is 1252, no labels, delimiter is '|', msq, header is 8 lines)where @5 &amp;gt;= '$(vLoadDate)' OR @5 = '';&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 14:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304573#M1200295</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-08T14:21:02Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304574#M1200296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, and thanks for helping me.&lt;BR /&gt;I am sorry to say that your code didn't fix it. Instead it gave me an even more strange result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Result: 5422&lt;/B&gt;&lt;BR /&gt;where @5&amp;gt;='$(vLoadDate)' OR @5='';&lt;/P&gt;&lt;P&gt;&lt;B&gt;Result: 3722&lt;/B&gt;&lt;BR /&gt;where @5 &amp;gt;= Date#(Today(1), 'yyyymmdd') OR @5 = '';&lt;/P&gt;&lt;P&gt;&lt;B&gt;Result: 3716&lt;/B&gt;&lt;BR /&gt;where @5&amp;gt;='20110208' OR @5='';&lt;/P&gt;&lt;P&gt;3716 I think is the accurate result of distinct id_nr.&lt;BR /&gt;These should all give the same result I think. Very strange to me.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 17:12:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304574#M1200296</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-02-08T17:12:22Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304575#M1200297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It's likely the variable is not being formatted properly, try the following instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vLoadDate = Date(Date#(Today()), 'YYYYMMDD')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;And then the load script as I posted above.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 18:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304575#M1200297</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-08T18:20:04Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304576#M1200298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did the change but unfortunately it didn't help.&lt;BR /&gt;I still get 4 dates in January 2011 (31, 23, 11, 09) which is REALLY strange to me.&lt;/P&gt;&lt;P&gt;Why does 20110208 give a different result than using today()???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could it be something else causing this...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 23:21:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304576#M1200298</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-02-08T23:21:21Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304577#M1200299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so, since if the variable is returning the proper value, it has the same effect thatn to set manualle the date in the format you do.&lt;/P&gt;&lt;P&gt;First, check that the variable stores the right value (you can go to Settings, Variable Overview, and check for vLoadDate) with the right format. For today, it must be 20110209 (without quotes).&lt;/P&gt;&lt;P&gt;Second, I always quote strings (literals) when passed as parameters, it may not be the case (although you are actually quoting when you hardcode the date in the WHERE statement).&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 07:08:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304577#M1200299</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-09T07:08:45Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304578#M1200300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I look under Variable Overview I can see that the value is not stored properly.&lt;BR /&gt;vLoadDate has a value of 20110009 !?!?&lt;BR /&gt;This explains why I get hits on January. How can QlikView create a month that's '00'?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 08:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304578#M1200300</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-02-09T08:43:21Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304579#M1200301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the document itself, create a text object and write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=Date(Today(), 'YYYYMMDD')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;To see whether there is any problem with dates and formats in QlikView. If that shows "20110209" then use that in the variable an reload the excel spreadsheet according to the code write above.&lt;/P&gt;&lt;P&gt;But yes, that's something strange and the reason why the records are not being loaded properly.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 08:55:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304579#M1200301</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-09T08:55:08Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304580#M1200302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;first of all: try to use 'YYYYMMDD' instead of 'yyyymmdd' (caps on), because qlikview may interpretate mm as minutes, when MM is month.&lt;/P&gt;&lt;P&gt;then, why are you using the date#() function? isn't that to format text string? instead today() return a number value, did u try with the date() function?&lt;/P&gt;&lt;P&gt;Date(Today(),'YYYYMMDD').&lt;/P&gt;&lt;P&gt;let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 10:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304580#M1200302</guid>
      <dc:creator>lucas4bi</dc:creator>
      <dc:date>2011-02-09T10:52:12Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304581#M1200303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help. Finally it is working.&lt;BR /&gt;&lt;BR /&gt;Final code is:&lt;BR /&gt;LET vLoadDate = Date(Today(), 'YYYYMMDD');&lt;/P&gt;&lt;P&gt;and then after the load...&lt;BR /&gt;where @5&amp;gt;='$(vLoadDate)' OR @5='';&lt;/P&gt;&lt;P&gt;So what have I learned....I need to put the date in a variable and that I have to use quotes around variable, like '$(vLoadDate)'.&lt;BR /&gt;YYYYMMDD needs to be in capitals too.&lt;/P&gt;&lt;P&gt;But it's still a mystery to me why this doesn't work:&lt;BR /&gt;where @5&amp;gt;=Date(Today(), 'YYYYMMDD') OR @5='';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thanks to everybody that help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 21:50:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304581#M1200303</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-02-09T21:50:59Z</dc:date>
    </item>
    <item>
      <title>Using today() function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304582#M1200304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johan,&lt;/P&gt;&lt;P&gt;That WHERE statement is correct and it should work if the function Date() is evaluated properly. The following code works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;RawData:LOAD Date(Date('01/01/2010') + Rand() * 730, 'YYYYMMDD') AS DateAUTOGENERATE 2000; // Just dummy data to compare with ValidData:LOAD *, RecNo() AS Dummy // Another field to not concatenate with previous tableRESIDENT RawDataWHERE Date &amp;lt; Date(Today(), 'YYYYMMDD'); // Here the date is being evaluated correctly DROP TABLE RawData;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In the example above, "Date" field as an actual date field (so numeric) and that allows not to quote the function. So to properly evaluate the date when it's a string and passed as valid value for a field, it would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vToday = Date(Today(), 'YYYYMMDD'); RawData:LOAD Text(Date(Date('01/01/2010') + Rand() * 730, 'YYYYMMDD')) AS DateAUTOGENERATE 2000; ValidData:LOAD *, RecNo() AS DummyRESIDENT RawDataWHERE Date &amp;lt; '$(vToday)'; DROP TABLE RawData;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 22:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-today-function/m-p/304582#M1200304</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-09T22:50:52Z</dc:date>
    </item>
  </channel>
</rss>

