<?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: Help on Date comparission in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526848#M196913</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I have a date filed which is of timestamp&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's where your problem is. Look at the output of num(Date Field). You'll see that there is a fraction, which is the time part of the date time. If you want to calculate using the date parts only you need to use the floor function to cut of the time part: today() - floor(Date Field)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;And important thing is when Today is 01-01-2014 and Date(Date field) = 31-12-2013 it is giving -20.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That sounds like the string of the date is interpreted as numbers:&lt;/P&gt;&lt;P&gt;1 -1 - 2014 = -2014&lt;/P&gt;&lt;P&gt;31 - 12 - 2013 = -1994&lt;/P&gt;&lt;P&gt;-2014 - -1994 = -2014 + 1994 = -20&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Dec 2013 13:43:36 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-12-26T13:43:36Z</dc:date>
    <item>
      <title>Help on Date comparission</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526847#M196912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing some manipulations.&lt;/P&gt;&lt;P&gt;I have a date filed which is of timestamp. So i have converted into Date(Date field)&lt;/P&gt;&lt;P&gt;When i am doing Today() - Date(Date field) it is not giving result as expected.&lt;/P&gt;&lt;P&gt;Example IF&lt;/P&gt;&lt;P&gt;Date(Date field) = 25-12-2013 the output is 0&lt;/P&gt;&lt;P&gt;Date(Date field) = 26-12-2013 the output is -0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And important thing is when Today is 01-01-2014 and Date(Date field) = 31-12-2013 it is giving -20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one tell me where i am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 13:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526847#M196912</guid>
      <dc:creator />
      <dc:date>2013-12-26T13:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Date comparission</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526848#M196913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I have a date filed which is of timestamp&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's where your problem is. Look at the output of num(Date Field). You'll see that there is a fraction, which is the time part of the date time. If you want to calculate using the date parts only you need to use the floor function to cut of the time part: today() - floor(Date Field)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;And important thing is when Today is 01-01-2014 and Date(Date field) = 31-12-2013 it is giving -20.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That sounds like the string of the date is interpreted as numbers:&lt;/P&gt;&lt;P&gt;1 -1 - 2014 = -2014&lt;/P&gt;&lt;P&gt;31 - 12 - 2013 = -1994&lt;/P&gt;&lt;P&gt;-2014 - -1994 = -2014 + 1994 = -20&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 13:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526848#M196913</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-26T13:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Date comparission</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526849#M196914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Floor function is solving my problem.&lt;/P&gt;&lt;P&gt;What about the second case ?&lt;/P&gt;&lt;P&gt;When Today = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;1 -1 - 2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;and Floor(Datefield ) = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;31 - 12 - 2013&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it give -20 or 1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 14:11:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526849#M196914</guid>
      <dc:creator />
      <dc:date>2013-12-26T14:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Date comparission</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526850#M196915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No idea. I can't read minds so I have no idea what you're actually doing. You can't simply use a string 31-12-2013 and expect it to be treated as a date. Use the date# function to create a date from a string or use the makedate function: makedate(2013,12,1).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 15:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-Date-comparission/m-p/526850#M196915</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-26T15:07:51Z</dc:date>
    </item>
  </channel>
</rss>

