<?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 Issue with yeartodate() timestamp in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227225#M500346</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry,&lt;/P&gt;&lt;P&gt;Make this more clear:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT_YTD = '2011-02-18'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the variable name as in my example I get a doubled answer (exactly twice what I am expecting).&lt;/P&gt;&lt;P&gt;If I simply enter '2011-02-18' into the yeartodate() formula as my timestamp I get the correct answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is driving me crazy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Feb 2011 16:52:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-24T16:52:38Z</dc:date>
    <item>
      <title>Issue with yeartodate() timestamp</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227222#M500341</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 am trying to use the yeartodate() function in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count(if(yeartodate(R_SALE_START_DATE,0,1,REPORT_YTD),R_ACCOUNT_NUMBER))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT_YTD is a distinct value (a date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is simple, this function should provide me exactly what I need but something is happening with the ref_timestamp (REPORT_YTD). If I remove this ref_timestamp and just let the function default to today's date I get the results I want, but if I include this variable which is a few days earlier than today's date, I get values twice the size.&lt;/P&gt;&lt;P&gt;As a final test, if I simply write the date (e.g. '2011-02-18') instead of using the field, then I get the correct values!!&lt;/P&gt;&lt;P&gt;One work around I can see (failing to get help on this issue) is to test the dates, so part 2 of my question is to evaluate dates (i.e. &amp;lt; = &amp;lt;=, &amp;gt;, ) can someone please shed some light on the correct evaluation syntax for date fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 18:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227222#M500341</guid>
      <dc:creator />
      <dc:date>2011-02-23T18:28:41Z</dc:date>
    </item>
    <item>
      <title>Issue with yeartodate() timestamp</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227223#M500342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am assuming that REPORT_YTD is a variable that you have manually entered. If so, QlikView doesn't know the data type. I would add the DATE function into your formula.&lt;/P&gt;&lt;P&gt;=Count(if(yeartodate(R_SALE_START_DATE,0,1,Date(REPORT_YTD,'YYYY-MM-DD')),R_ACCOUNT_NUMBER))&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aline&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 18:46:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227223#M500342</guid>
      <dc:creator />
      <dc:date>2011-02-23T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Issue with yeartodate() timestamp</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227224#M500344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion.&lt;/P&gt;&lt;P&gt;If I do Date(REPORT_YTD) it gives me a result that is exactly double the true result. This seems extremely odd, has anyone had this happen before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 16:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227224#M500344</guid>
      <dc:creator />
      <dc:date>2011-02-24T16:17:57Z</dc:date>
    </item>
    <item>
      <title>Issue with yeartodate() timestamp</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227225#M500346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry,&lt;/P&gt;&lt;P&gt;Make this more clear:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT_YTD = '2011-02-18'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the variable name as in my example I get a doubled answer (exactly twice what I am expecting).&lt;/P&gt;&lt;P&gt;If I simply enter '2011-02-18' into the yeartodate() formula as my timestamp I get the correct answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is driving me crazy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 16:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227225#M500346</guid>
      <dc:creator />
      <dc:date>2011-02-24T16:52:38Z</dc:date>
    </item>
    <item>
      <title>Issue with yeartodate() timestamp</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227226#M500348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding a DISTINCT into the formula:&lt;/P&gt;&lt;P&gt;Count( Distinct if(yeartodate(R_SALE_START_DATE,0,1,Date(REPORT_YTD)),R_ACCOUNT_NUMBER))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Feb 2011 16:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-yeartodate-timestamp/m-p/227226#M500348</guid>
      <dc:creator />
      <dc:date>2011-02-25T16:11:16Z</dc:date>
    </item>
  </channel>
</rss>

