<?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: Time difference in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75001#M774024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD/MM/YYYY hh:mm:ss:TT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is incorrect. TT is the AM/PM indicator so it has converted the time to a 12 hour clock and you are rounding the display to the nearest second. You need format string '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD/MM/YYYY hh:mm:ss.fff'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; difference between end and start time is showing 00 , however it should be 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Not necessarily. Your format has hidden but not removed the second fractions, so the difference might be less than 0.5 seconds, which will round down to 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If the field EndTime and StartTime are loaded as strings, then you need to convert with&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TimeStamp#(EndTime, 'yyyy-MM-dd hh:mm:ss.fff')&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 May 2018 07:06:24 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2018-05-09T07:06:24Z</dc:date>
    <item>
      <title>Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/74998#M774021</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;In our data base we have date field as&amp;nbsp; below , Year-month-day hours:min:sec:nano sec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2018-03-23 22:32:24.043&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am pulling the date field in the load script from the DB , it is reading as "DD/MM/YYYY hh:mm:ss:TT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) My first question is why it is discarding the nano second &lt;/P&gt;&lt;P&gt;2) I want to calculate end date and start date in terms of second so I am using the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Interval((EndTime) - (StartTime),'ss') &lt;/P&gt;&lt;P&gt; But for some cases it is not showing right value. &lt;/P&gt;&lt;P&gt; for example difference between end and start time is showing 00 , however it should be 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201910_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Kindly give your input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/74998#M774021</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/74999#M774022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you share your sample qvw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 06:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/74999#M774022</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2018-05-09T06:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75000#M774023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hi,&lt;BR /&gt;&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;SET TimestampFormat='m/dd/yyyy h:mm:ss TT';&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;LOAD * ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;interval(endTime-startTime) as Diff&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;INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; startTime, endTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/24/2018 5:02:53 AM, 4/24/2018 5:02:54 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;];&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;&lt;IMG alt="Capture1yfugh.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201919_Capture1yfugh.PNG" style="height: 382px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 06:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75000#M774023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-09T06:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75001#M774024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD/MM/YYYY hh:mm:ss:TT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is incorrect. TT is the AM/PM indicator so it has converted the time to a 12 hour clock and you are rounding the display to the nearest second. You need format string '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD/MM/YYYY hh:mm:ss.fff'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; difference between end and start time is showing 00 , however it should be 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Not necessarily. Your format has hidden but not removed the second fractions, so the difference might be less than 0.5 seconds, which will round down to 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If the field EndTime and StartTime are loaded as strings, then you need to convert with&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TimeStamp#(EndTime, 'yyyy-MM-dd hh:mm:ss.fff')&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 07:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75001#M774024</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2018-05-09T07:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75002#M774025</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;&lt;/P&gt;&lt;P&gt;It seems my starttime and endtime is loading as text , do I need to change it in the load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TimeStamp#(Start_Time, 'YYYY-MM-DD hh:mm:ss.fff') as Start_Time, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing this in the load script I see my chart is disappearing .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your input is very helpful though.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 07:34:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75002#M774025</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2018-05-09T07:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Time difference</title>
      <link>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75003#M774026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aruna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response . It did not work. I believe in our db we have Nano seconds so while calculating the difference I need to consider second and Nano second.&lt;/P&gt;&lt;P&gt;I wanted to skip the Nano second part though. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 09:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-difference/m-p/75003#M774026</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2018-05-09T09:13:14Z</dc:date>
    </item>
  </channel>
</rss>

