<?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: Current Date variable in set analysis not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745262#M1041308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try "&amp;gt;=$(=date($(vCurrentDate)))"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Dec 2014 12:10:21 GMT</pubDate>
    <dc:creator>jpenuliar</dc:creator>
    <dc:date>2014-12-16T12:10:21Z</dc:date>
    <item>
      <title>Current Date variable in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745260#M1041304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm having trouble getting correct answer when using a variable I created (to give the CurrentDate value) in the set analysis part of an expression I am creating.&amp;nbsp; I'd like to use this in various objects in a dashboard the following example is from a simple text object I've created just to make sure the answer is correct!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to show is a list of Work Orders which:&lt;/P&gt;&lt;P&gt;a) have a status of "Open" and&lt;/P&gt;&lt;P&gt;b) are assigned to an engineer on a date in the future&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, when I'm happy that I'm getting the correct answer, the expression will be used in a straight table to list the required Work Orders.&amp;nbsp; For example what I'm asking is, display list of work orders based on: count of work orders ("wr_id" field) where status = "open" and date_assigned &amp;gt;=CurrentDate (greater or equal to today's date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the actual date typed into the set analysis of the expression gives the correct answer (which is 17):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'}, &lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={'&amp;gt;=16/12/2014'}&amp;gt;}&lt;SPAN style="color: maroon;"&gt;wr_id&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT if I try using the CurrentDate variable I set up (vCurrentDate), it gives an answer of "0"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'},&lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;gt;=$(vCurrentDate)"&lt;/SPAN&gt;}&amp;gt;}&lt;SPAN style="color: maroon;"&gt;wr_id&lt;/SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'},&lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={'&amp;gt;=$(vCurrentDate)'}&amp;gt;}&lt;SPAN style="color: maroon;"&gt;wr_id&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As another example, if I try this I get "-" as the result in the text object:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'},&lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={&amp;gt;=&lt;STRONG&gt;&lt;EM style="color: gray;"&gt;$(vCurrentDate)&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}wr_id) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried all of the examples above and neither give the correct answer!&lt;/P&gt;&lt;P&gt;The variable is OK as I've tested this in a text object to make sure it does return the date and it's OK.&lt;/P&gt;&lt;P&gt;the variable is created in the script as:&lt;SPAN style="font-size: 10pt;"&gt; &lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;STRONG&gt;&lt;EM style="color: gray;"&gt;vCurrentDate&lt;/EM&gt;&lt;/STRONG&gt; = today(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;BUT for some reason it doesn't seem to like it when I use it in the expression as the set analysis part of the date_assigned field (even though the Edit Expression dialogue box indicates the expressions are OK).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've searched the forums can't find anything which helps so far.&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If anyone can tell me where I'm going wrong, I would greatly appreciate it!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 12:04:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745260#M1041304</guid>
      <dc:creator />
      <dc:date>2014-12-16T12:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Current Date variable in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745261#M1041306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the default date format of your script?&lt;/P&gt;&lt;P&gt;CHECK&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET DateFormat='DD/MM/YYYY';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Or use&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vCurrentDate = today();&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 12:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745261#M1041306</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-16T12:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Current Date variable in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745262#M1041308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try "&amp;gt;=$(=date($(vCurrentDate)))"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 12:10:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745262#M1041308</guid>
      <dc:creator>jpenuliar</dc:creator>
      <dc:date>2014-12-16T12:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Current Date variable in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745263#M1041310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish&lt;/P&gt;&lt;P&gt;default date format is set how you've described &lt;/P&gt;&lt;P&gt;added new variable based on LET type and it worked with following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 7.5pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'},&lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={'&amp;gt;=$(vCurrentDate3)'}&amp;gt;}&lt;SPAN style="color: maroon;"&gt;wr_id&lt;/SPAN&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now need to read up on difference between SET and LET variables.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing me in right direction &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 13:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745263#M1041310</guid>
      <dc:creator />
      <dc:date>2014-12-16T13:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Current Date variable in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745264#M1041312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan&lt;/P&gt;&lt;P&gt;I tried the other suggestion first, which worked so marked that one as correct answer, but then tried your suggestion as well, which also worked with following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 7.5pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;DISTINCT&lt;/SPAN&gt;{&amp;lt;&lt;SPAN style="color: maroon;"&gt;status_cat&lt;/SPAN&gt;={'open'},&lt;SPAN style="color: maroon;"&gt;date_assigned&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;gt;=$(=date($(vCurrentDate)))"&lt;/SPAN&gt;}&amp;gt;}&lt;SPAN style="color: maroon;"&gt;wr_id&lt;/SPAN&gt;)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So thanks you for your help in pointing me in right direction &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 13:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Date-variable-in-set-analysis-not-working/m-p/745264#M1041312</guid>
      <dc:creator />
      <dc:date>2014-12-16T13:38:07Z</dc:date>
    </item>
  </channel>
</rss>

