<?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: Selecting data with a Date variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446313#M166487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, forgot some '(' and ')' -'s &lt;/P&gt;&lt;P&gt;WHERE MyDate = $(vTodaysDate) OR MyDate = $(vTodaysDateMinus1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(variable) construction is called dollar expansion. See &lt;A _jive_internal="true" href="https://community.qlik.com/message/274604#274604"&gt;here&lt;/A&gt; for an explanation of the why and how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2012 14:44:43 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-11-19T14:44:43Z</dc:date>
    <item>
      <title>Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446308#M166482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New to Qlikview, and I've poured over posts and documentation and can't find the answer to what should be a very basic question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading a set of records from an excel spreadsheet, this is no problem. However, in the spreadsheet is a date column, and all I want to do is select records where the date falls into a simple range, and I want the dates to be variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So lets say I am :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD MyDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Colum2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Column3&lt;/P&gt;&lt;P&gt;FROM MySpreadsheet.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my WHERE I want to have WHERE MyDate = vTodaysDate OR MyDate = vTodaysDateMinus1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Being that vTodaysDate = Today()&lt;/P&gt;&lt;P&gt;and vTodaysDateMinus1 = Today()-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So before the LOAD I am setting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vTodaysDate = Today();&lt;/P&gt;&lt;P&gt;LET vTodaysDateMinus1 = Today() -1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am leaving some stuff out here, but there is a reason why I want to use the variables versus just using Today() in the WHERE clause. Which does work btw. However, anytime I try to use a variable in its place, my Load returns nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ahead of time for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 13:51:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446308#M166482</guid>
      <dc:creator />
      <dc:date>2012-11-19T13:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446309#M166483</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 like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * from filename.xls&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;match(MyDate,$(vTodaysDate), $(vTodaysDateMinus1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 13:59:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446309#M166483</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-11-19T13:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446310#M166484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome this worked! Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Follow up question though... Do I always have to use MATCH when comparing values in columns to values in variables? This is the first time I am seeing the MATCH function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:23:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446310#M166484</guid>
      <dc:creator />
      <dc:date>2012-11-19T14:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446311#M166485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No,&amp;nbsp; WHERE MyDate = $vTodaysDate OR MyDate = $vTodaysDateMinus1 should work as well. The match function is used where in sql you would use IN ('Val1','Val2'...). You can also use it if you use OR for several comparisons on the same field, as is the case in your where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:28:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446311#M166485</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-19T14:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446312#M166486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert, thanks, but when I try to do that, I get the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;$vTodaysDate&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does the $ mean anyway?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:41:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446312#M166486</guid>
      <dc:creator />
      <dc:date>2012-11-19T14:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446313#M166487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, forgot some '(' and ')' -'s &lt;/P&gt;&lt;P&gt;WHERE MyDate = $(vTodaysDate) OR MyDate = $(vTodaysDateMinus1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(variable) construction is called dollar expansion. See &lt;A _jive_internal="true" href="https://community.qlik.com/message/274604#274604"&gt;here&lt;/A&gt; for an explanation of the why and how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446313#M166487</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-19T14:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data with a Date variable</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446314#M166488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Gysbert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-data-with-a-Date-variable/m-p/446314#M166488</guid>
      <dc:creator />
      <dc:date>2012-11-19T14:48:12Z</dc:date>
    </item>
  </channel>
</rss>

