<?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: Date range in set expression wrong since update in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81700#M13446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a hunch, try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deliverydate = {"&amp;gt;=$(=Date(vYearStartToday))&amp;lt;= $(=Date(vYearEndToday))"}&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Deliverydate = {"&amp;gt;=$(=Date($(vYearStartToday)))&amp;lt;= $(=Date($(vYearEndToday)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether the variable has the leading "=".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2018 07:59:13 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2018-05-24T07:59:13Z</dc:date>
    <item>
      <title>Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81691#M13437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since updating to November release 2017 SR4 I'm experiencing difficulties with some set expressions in text fields and chart expressions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this might have something to do with the single quote and double quote changes due to this upgrade but still I'm not finding the correct solution for the daterange-part:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Old formula =&lt;/P&gt;&lt;P&gt; sum({1&amp;lt;OrderType={DELIVERIES}, Invoiced={'no yet'}, Deliverydate={'&amp;gt;=$(=num(YearStart(Today()),'#0'))&amp;lt;$(=num(YearEnd(Today()),'#0'))'}&amp;gt;} DeliveryValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In new formula I'm sure I need to make the single quotes now double quotes:&lt;/P&gt;&lt;P&gt;Deliverydate={"&amp;gt;=$(=num(YearStart(Today()),'#0'))&amp;lt;$(=num(YearEnd(Today()),'#0'))"}&lt;/P&gt;&lt;P&gt;but that doesn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I thought about storing YearStart and YearEnd in variables and using them:&lt;/P&gt;&lt;P&gt;vYearStartToday with definition as =YearStart(Today())&lt;/P&gt;&lt;P&gt;vYearEndToday with definition as = YearEnd(Today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and changing the daterange-part in my set expression to:&lt;/P&gt;&lt;P&gt;Deliverydate={"&amp;gt;= $(vYearStartToday) &amp;lt; $(vYearEndToday)"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still no luck...&lt;/P&gt;&lt;P&gt;even playing around with my variable definitions doesn't bring the right solution:&lt;/P&gt;&lt;P&gt;definition as =num(YearStart(Today()),'#0') or as YearStart(Today()) doesn't help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Davy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:06:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81691#M13437</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-23T15:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81692#M13438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The double quotes are right, they need to be used as long as the expression does not return a number or a string, but a range, a search or it contains a wildcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the Deliverydate field store numeric values, comparable to the Num() returned in the expression (e.g.: Today() will return 43242)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81692#M13438</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-05-23T15:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81693#M13439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the deliverydate is in number format?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81693#M13439</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-23T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81694#M13440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Davy,&lt;/P&gt;&lt;P&gt;Would you be able to share a sample app?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;RT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81694#M13440</guid>
      <dc:creator>Neymar_Jr</dc:creator>
      <dc:date>2018-05-23T15:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81695#M13441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deliverydate field is marked as 'mixed',&lt;/P&gt;&lt;P&gt;when I put in in a table it is in format 'DD/MM/YYYY' what is the same format as my result for =Today() and =YearStart(Today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(but why did I in the past need to use num value?? maybe in the database this value has changed format?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81695#M13441</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-23T15:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81696#M13442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is only small part of very large qvw so sorry I can't help you with that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81696#M13442</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-23T15:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81697#M13443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something strange is also when I use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variable definition "=YearStart(Today())" =&amp;gt; $(vYearStartToday) gives 0.0004955401&lt;/P&gt;&lt;P&gt;variable definition "YearStart(Today())" =&amp;gt; $(vYearStartToday) gives 01/01/2018&lt;/P&gt;&lt;P&gt;variable definition "=num(YearStart(Today()))" =&amp;gt; $(vYearStartToday) gives 43101&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 15:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81697#M13443</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-23T15:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81698#M13444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Makes sense:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The first one is taking the date as a formula and evaluating it, because of the leading "=": 1 divided by 1 divided by 2018 = 0.000495&lt;/LI&gt;&lt;LI&gt;The second returns what the function returns, which is a date format&lt;/LI&gt;&lt;LI&gt;Any date in QlikView and Qlik Sense has both a numeric representation, counting from day 1 which is 31/12/1899 and a string representation which is DD/MM/YYYY or whatever the format you have specified in the variables at the beginning of the script or by default, those of the operating system. &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Number 3 is very convenient because the numeric value does not change regardless the locale settings of the computer of the developer, the server or the user, and it's always faster to use numeric values instead of strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So back to your original issue, you need to make sure that both Deliverydate and the variable return the same format. You can create the Num() equivalent for Deliverydate already in the script, and use it for set analysis and comparisons, and use Deliverydate (date format) for representation in the charts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 06:21:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81698#M13444</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-05-24T06:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81699#M13445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This got me thinking and I’ve come up with something that works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I let my variable come out in date format:&lt;/P&gt;&lt;P&gt;date(YearStart(Today()))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I’ve added if() function in my set expression:&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;OrderType={DELIVERIES}, Invoiced={'not yet'}&amp;gt;}&lt;/P&gt;&lt;P&gt;if(Deliverydate &amp;gt;= $(vYearStartToday), if(Deliverydate &amp;lt;= $(vYearEndToday), DeliveryValue)))&lt;/P&gt;&lt;P&gt;And it gives the correct result !! So thank a lot for your input !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I still don’t get why:&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;OrderType={DELIVERIES}, Invoiced={'not yet'},&lt;/P&gt;&lt;P&gt;Deliverydate={"&amp;gt;= $(vYearStartToday) &amp;lt;= $(vYearEndToday)"}&amp;gt;} DeliveryValue)&lt;/P&gt;&lt;P&gt;doesn’t give the same result… maybe it has something to do with the double quotes interfering with the variable retrieval&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Davy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Van: Miguel Angel Baeyens de Arce &lt;/P&gt;&lt;P&gt;Verzonden: donderdag 24 mei 2018 8:22&lt;/P&gt;&lt;P&gt;Aan: Davy Michiels&lt;/P&gt;&lt;P&gt;Onderwerp: Re:  - Date range in set expression wrong since update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 07:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81699#M13445</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-24T07:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81700#M13446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a hunch, try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deliverydate = {"&amp;gt;=$(=Date(vYearStartToday))&amp;lt;= $(=Date(vYearEndToday))"}&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Deliverydate = {"&amp;gt;=$(=Date($(vYearStartToday)))&amp;lt;= $(=Date($(vYearEndToday)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether the variable has the leading "=".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 07:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81700#M13446</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-05-24T07:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81701#M13447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost there ☺&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-          the first option doesn’t work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-          the second option only works partly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first part is ok : only values with dates after start of this year&lt;/P&gt;&lt;P&gt;but the second part doesn’t get picked up as my results show values for 2019, meaning &amp;lt;= end of this year doesn’t work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 08:25:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81701#M13447</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-24T08:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81702#M13448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you will have to check that the variable gets the right date and that there is data for that time, the syntax is OK as long as both are defined the same way (both with leading "=" or both without, both with Num() or neither, etc.) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 08:36:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81702#M13448</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-05-24T08:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81703#M13449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) no need to worry for date format of my variable: variable definition is simply YearStart(Today()) end YearEnd(Today())&lt;/P&gt;&lt;P&gt;2) your second formula works perfect after I made one simple adjustment: apparently there may not be a blank space between the &amp;lt;= and the following $-sign&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Deliverydate = {"&amp;gt;=$(=Date($(vYearStartToday)))&lt;STRONG&gt;&amp;lt;=$&lt;/STRONG&gt;(=Date($(vYearEndToday)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I've never known blank spaces could pose a problem here!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 08:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81703#M13449</guid>
      <dc:creator>davymichiels</dc:creator>
      <dc:date>2018-05-24T08:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set expression wrong since update</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81704#M13450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked! Yep, blanks in search strings or literals count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 09:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-expression-wrong-since-update/m-p/81704#M13450</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-05-24T09:42:48Z</dc:date>
    </item>
  </channel>
</rss>

