<?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 between Two timestamps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390485#M1158060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Decision Date &amp;amp; Time,Log Date &amp;amp; Time&lt;/P&gt;&lt;P&gt;2012/12/31 4:15:00 PM,2012/12/30 2:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/29 3:10:00 PM,2012/12/28 3:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/28 5:10:00 PM,2012/12/27 4:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/25 6:10:00 PM,2012/12/22 9:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/26 2:10:00 PM,2012/12/23 6:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/27 1:10:00 PM,2012/12/26 8:10:00 PM&lt;/P&gt;&lt;P&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then reload the Data And Take a Listbox and Go to Expression wite this Expresssion&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Interval(Date(Date#([Decision Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]'))-Date(Date#([Log Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]')),'hh:mm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2013 12:46:21 GMT</pubDate>
    <dc:creator>sreenivas</dc:creator>
    <dc:date>2013-01-03T12:46:21Z</dc:date>
    <item>
      <title>Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390477#M1158052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having problems with time format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my load script I have:&lt;/P&gt;&lt;P&gt; &lt;EM&gt;&lt;STRONG&gt;Timestamp(Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss')) as [Log Date &amp;amp; Time],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; Timestamp(Timestamp#( [Decision Date], 'DD-MMM-YYYY hh:mm:ss')) as [Decision Date &amp;amp; Time],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an expression (not in the load script) I then want to calculate my avergae "Process Time", which is the average time difference the two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the wrong values whenever the time taken is more than 24 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, if log date is 2012/12/30 3:10:00 PM and Decision Date is 2012/12/31 4:15:00 PM, I get an answer of 1:05:00, when it should be 25:05:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I should use interval but cannot get the format of the expression right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390477#M1158052</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-03T12:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390478#M1158053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=Interval(Date(Date#('2012/12/31 4:15:00 PM','YYYY/MM/DD h:mm:ss [ttt]'))-Date(Date#('2012/12/30 3:10:00 PM','YYYY/MM/DD h:mm:ss [ttt]')),'hh:mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:23:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390478#M1158053</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2013-01-03T12:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390479#M1158054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this, but it returns NULL value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Interval(Date(Date#([Decision Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]'))-&lt;/P&gt;&lt;P&gt;Date(Date#([Log Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]')),'hh:mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390479#M1158054</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-03T12:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390480#M1158055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the above will work in the text object only. If you want to use by Field names then Try in the Straight table By givng this expression.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Because that fields contains more than one value.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390480#M1158055</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2013-01-03T12:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390481#M1158056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry not sure what you mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is an expression in a straight table I am using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:32:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390481#M1158056</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-03T12:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390482#M1158057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you add qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:33:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390482#M1158057</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2013-01-03T12:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390483#M1158058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I can't - will have to create a sample file of this - plus I have Personal Edition so can't look at a file you then return to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But these are my document date formats:&lt;/P&gt;&lt;P&gt;SET TimeFormat='hh:mm:ss TT';&lt;/P&gt;&lt;P&gt;SET DateFormat='YYYY/MM/DD';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='YYYY/MM/DD hh:mm:ss[.fff] TT';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the first comment shows how I loaded these fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:35:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390483#M1158058</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-03T12:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390484#M1158059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that Fields(Columns) [Decision Date &amp;amp; Time],[Log Date &amp;amp; Time]&lt;/P&gt;&lt;P&gt; how many rows are there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the dimension you are giving?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add sample data for clear your doubt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390484#M1158059</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2013-01-03T12:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390485#M1158060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Decision Date &amp;amp; Time,Log Date &amp;amp; Time&lt;/P&gt;&lt;P&gt;2012/12/31 4:15:00 PM,2012/12/30 2:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/29 3:10:00 PM,2012/12/28 3:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/28 5:10:00 PM,2012/12/27 4:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/25 6:10:00 PM,2012/12/22 9:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/26 2:10:00 PM,2012/12/23 6:10:00 PM&lt;/P&gt;&lt;P&gt;2012/12/27 1:10:00 PM,2012/12/26 8:10:00 PM&lt;/P&gt;&lt;P&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then reload the Data And Take a Listbox and Go to Expression wite this Expresssion&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Interval(Date(Date#([Decision Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]'))-Date(Date#([Log Date &amp;amp; Time],'YYYY/MM/DD h:mm:ss [ttt]')),'hh:mm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 12:46:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390485#M1158060</guid>
      <dc:creator>sreenivas</dc:creator>
      <dc:date>2013-01-03T12:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time between Two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390486#M1158061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you misunderstood my requirement. I have a million records with different timestamps for those two fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to do this without changing the load scripts and QVD, but this works now that I have this in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; interval(Timestamp( Timestamp#([Decision Date], 'DD-MMM-YYYY hh:mm:ss') - Timestamp(Timestamp#( [Log Date], 'DD-MMM-YYYY hh:mm:ss')) ),'hh:mm:ss') as Process_Time,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 13:09:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-between-Two-timestamps/m-p/390486#M1158061</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-03T13:09:03Z</dc:date>
    </item>
  </channel>
</rss>

