<?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 Difference of 2 date values in seconds in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240460#M90991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try (interval(time(time1)-time(time2),'ss') ?&lt;/P&gt;&lt;P&gt;Are you sure time1 and time2 are really in time format ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Nov 2009 20:49:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-13T20:49:52Z</dc:date>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240459#M90990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought it would be easy, get the difference of 2 date/time values in seconds.&lt;/P&gt;&lt;P&gt;However - whatever I tried (and I tried a lot) - I end up either in a date or a null value&lt;/P&gt;&lt;P&gt;num#((time1 - time2) * 86400)&lt;/P&gt;&lt;P&gt;interval#(time1 - time2,'ss')&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;Thanks, Jürg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 19:15:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240459#M90990</guid>
      <dc:creator />
      <dc:date>2009-11-13T19:15:03Z</dc:date>
    </item>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240460#M90991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try (interval(time(time1)-time(time2),'ss') ?&lt;/P&gt;&lt;P&gt;Are you sure time1 and time2 are really in time format ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 20:49:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240460#M90991</guid>
      <dc:creator />
      <dc:date>2009-11-13T20:49:52Z</dc:date>
    </item>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240461#M90992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Spastor&lt;/P&gt;&lt;P&gt;Had also my doubts about the format, I am actually reading the date/time from a csv file and I assume I have always seen string values and not dates.&lt;/P&gt;&lt;P&gt;I have changed my load statement now to use&lt;/P&gt;&lt;P&gt;timestamp#(SCHEDULEDDEPARTURETIME, 'DD/MM/YYYY hh:mm:ss') as SCHEDULEDDEPARTURETIME,&lt;/P&gt;&lt;P&gt;and am able to calculate seconds using&lt;/P&gt;&lt;P&gt;(hour(SCHEDULEDDEPARTURETIME)*3600 + minute(SCHEDULEDDEPARTURETIME) * 60 + second(SCHEDULEDDEPARTURETIME))&lt;BR /&gt;- (hour(OBSERVED_DEPARTURE_TIME)*3600 + minute(OBSERVED_DEPARTURE_TIME) * 60 + second(OBSERVED_DEPARTURE_TIME)) as Departure_Deviation,&lt;/P&gt;&lt;P&gt;which still looks a bit over-complicated to me.&lt;/P&gt;&lt;P&gt;Using your suggested interval formula returns null.&lt;/P&gt;&lt;P&gt;Jürg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 21:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240461#M90992</guid>
      <dc:creator />
      <dc:date>2009-11-13T21:02:56Z</dc:date>
    </item>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240462#M90993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jürg,&lt;/P&gt;&lt;P&gt;here are a short example with different formats.&lt;/P&gt;&lt;P&gt;The expression is a little bit smaller as yours.&lt;/P&gt;&lt;P&gt;Have a nice weekend!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 22:36:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240462#M90993</guid>
      <dc:creator />
      <dc:date>2009-11-13T22:36:54Z</dc:date>
    </item>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240463#M90994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rainer&lt;/P&gt;&lt;P&gt;Finally, using correct date type values, I am able to calculate seconds using:&lt;/P&gt;&lt;P&gt;(num(SCHEDULED_DEPARTURE_TIME) - num(OBSERVED_DEPARTURE_TIME)) * 86400&lt;/P&gt;&lt;P&gt;which looks very familiar with other environments date/time calculations&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240463#M90994</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:47:00Z</dc:date>
    </item>
    <item>
      <title>Difference of 2 date values in seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240464#M90995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the times now being actual QlikView times, it should be as simple as (SCHEDULED_DEPARTURE_TIME-OBSERVED_DEPARTURE_TIME)*86400. The num() function probably isn't doing anything here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 00:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-of-2-date-values-in-seconds/m-p/240464#M90995</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-11-14T00:27:09Z</dc:date>
    </item>
  </channel>
</rss>

