<?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: Convert Time stamp to as is number in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1792696#M1210840</link>
    <description>&lt;P&gt;Glad you got it to work.&amp;nbsp; Just to give you more to chew on.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Time(from_date) as From_TimeOnly,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is improper.&amp;nbsp; Time() does not extract the time. It formats the Datetime as a string time. That forces you to reinterpret the value with Interpret#() when you use the field.&amp;nbsp; Instead if, you did&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Time(Frac(from_date)) as From_TimeOnly,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then your expression could be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;(To_TimeOnly - From_TimeOnly) * 1440&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;This becomes important for example, if you try to use From_TimeOnly as a chart Dimension or sort the field. It would not work if you use just the Time() function.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;-Rob&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 21:26:46 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2021-03-18T21:26:46Z</dc:date>
    <item>
      <title>Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789747#M1210483</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have following values&lt;/P&gt;&lt;P&gt;from_date&amp;nbsp;2020-01-01 12:00:00.000&lt;/P&gt;&lt;P&gt;to_date&amp;nbsp;2021-12-31 12:40:00.000&lt;/P&gt;&lt;P&gt;How do I get difference between these 2 date time stamp as 40&lt;/P&gt;&lt;P&gt;I can get difference but I want them in number as 40. Not 00:40&lt;/P&gt;&lt;P&gt;so I can sum the times as 40 + ...&lt;/P&gt;&lt;P&gt;Interval gives me difference but again in date timestamp format. not just the number 40.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used SQL query&lt;BR /&gt;isnull(convert(datetime, from_date), '8:00') as start_time,&lt;BR /&gt;isnull(convert(datetime, to_date), '18:00') as end_time&lt;BR /&gt;Then in Qlik script I used&lt;/P&gt;&lt;P&gt;Time(Interval(end_time-start_time),'mm') as Total --- This gives me timestamp again. Not in Number&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 17:48:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789747#M1210483</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2021-03-09T17:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789753#M1210487</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Num#(&lt;/STRONG&gt;Interval(end_time-start_time),'mm')&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;or&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;(end_time-start_time) * 1440&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Rob&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank" rel="noopener"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank" rel="noopener"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank" rel="noopener"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 18:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789753#M1210487</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-03-09T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789799#M1210493</link>
      <description>&lt;P&gt;Tried, but they give me difference for date range times.&lt;/P&gt;&lt;P&gt;from_date&amp;nbsp;&lt;STRONG&gt;2020-01-01&lt;/STRONG&gt; 12:00:00.000&lt;/P&gt;&lt;P&gt;to_date&amp;nbsp;&lt;STRONG&gt;2021-12-31&lt;/STRONG&gt; 12:40:00.000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date range above is from 01/01 to 12/31.. so it is giving diff of all the time between this range. But I just need 12:00 - 12:40.&lt;/P&gt;&lt;P&gt;I got it by using&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Time(Interval end_time- start_time),'mm').&lt;BR /&gt;In list box it looks like number but when you export it to excel or sum the values, it is giving incorrect answer.&lt;BR /&gt;Ex: 40 &amp;amp; 24 is 65 but I get 05&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 20:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789799#M1210493</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2021-03-09T20:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789832#M1210497</link>
      <description>&lt;P&gt;I recommend reading up on the difference between Formatting and Interpretation functions.&amp;nbsp; Here's a good article&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Sense-Documents/Dealing-with-date-formats-in-QlikView-and-QlikSense/ta-p/1484207" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Sense-Documents/Dealing-with-date-formats-in-QlikView-and-QlikSense/ta-p/1484207&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'll assume that your values are proper qlik timestamp values, that it, the number of days is the integer value and time is the fractional value.&amp;nbsp; If you want to ignore the date portion and just subtract the time portions use frac() to get the time (fractional) portion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frac(end_time) - Frac(start_time)&lt;/P&gt;&lt;P&gt;If you want that in minutes multiply the result by 1440.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 23:09:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1789832#M1210497</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-03-09T23:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1792656#M1210834</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used below expression in script to convert into mins with as is numbers.&lt;/P&gt;&lt;P&gt;First I extracted just the time&amp;nbsp; using&amp;nbsp;&lt;BR /&gt;Time(from_date) as From_TimeOnly,&lt;BR /&gt;Time(to_date) as To_TimeOnly,&lt;/P&gt;&lt;P&gt;Then to get only numbers&lt;BR /&gt;&lt;STRONG&gt;Interval#(To_TimeOnly, 'H:mm:ss TT') * 1440 - Interval#(From_TimeOnly, 'H:mm:ss TT') * 1440&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 19:07:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1792656#M1210834</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2021-03-18T19:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time stamp to as is number</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1792696#M1210840</link>
      <description>&lt;P&gt;Glad you got it to work.&amp;nbsp; Just to give you more to chew on.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Time(from_date) as From_TimeOnly,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is improper.&amp;nbsp; Time() does not extract the time. It formats the Datetime as a string time. That forces you to reinterpret the value with Interpret#() when you use the field.&amp;nbsp; Instead if, you did&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Time(Frac(from_date)) as From_TimeOnly,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then your expression could be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;(To_TimeOnly - From_TimeOnly) * 1440&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;This becomes important for example, if you try to use From_TimeOnly as a chart Dimension or sort the field. It would not work if you use just the Time() function.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;-Rob&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 21:26:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Time-stamp-to-as-is-number/m-p/1792696#M1210840</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2021-03-18T21:26:46Z</dc:date>
    </item>
  </channel>
</rss>

