<?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: Difference in hours between two timestamps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272322#M101988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might want to look into interval() function, I think that's what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=interval(vFixedTime - TimeStamp, 'hh')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edited by swuehl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Aug 2011 12:53:59 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-08-15T12:53:59Z</dc:date>
    <item>
      <title>Difference in hours between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272319#M101985</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;I have a &lt;STRONG&gt;fixed timestamp 11/08/2011 20:00&lt;/STRONG&gt; and then I have data collected over a time period with timestamps attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10/08/2011 16:32 , A&lt;/P&gt;&lt;P&gt;10/08/2011 16:45, A&lt;/P&gt;&lt;P&gt;11/08/2011 12:33, A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a field that has the number of hours before or after my fixed timestamp.&amp;nbsp; So for example, the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Timestamp, hours&lt;/P&gt;&lt;P&gt;11/08/2011 19:23, -1&amp;nbsp;&amp;nbsp;&amp;nbsp; //because it is within the previous hour&lt;/P&gt;&lt;P&gt;11/08/2011 14:02, -6&lt;/P&gt;&lt;P&gt;11/08/2011 20:00, 0&lt;/P&gt;&lt;P&gt;11/08/2011 20:55, 0&amp;nbsp; // because it is still within the hour&lt;/P&gt;&lt;P&gt;11/08/2011 21:05, 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thanks would be greatly appreciated!&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;Gareth &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 11:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272319#M101985</guid>
      <dc:creator />
      <dc:date>2011-08-15T11:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in hours between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272320#M101986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hei &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attach is an example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope its helps you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 12:34:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272320#M101986</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2011-08-15T12:34:54Z</dc:date>
    </item>
    <item>
      <title>Difference in hours between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272321#M101987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; this would be my solution:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;let &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTimestamp&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(2011,8,15)+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Time&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('20:00','hh:mm');&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTime&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;();&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vDifference&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ceil&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vTimestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'h') - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;vTime&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'h'),'h')*24);&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;TRACE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; Timestamp: &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vTimestamp)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; - actual Time: &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vTime)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vDifference)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;MFG&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 12:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272321#M101987</guid>
      <dc:creator />
      <dc:date>2011-08-15T12:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in hours between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272322#M101988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might want to look into interval() function, I think that's what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=interval(vFixedTime - TimeStamp, 'hh')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edited by swuehl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 12:53:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-in-hours-between-two-timestamps/m-p/272322#M101988</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-15T12:53:59Z</dc:date>
    </item>
  </channel>
</rss>

