<?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: Converting Seconds to hh:mm:ss format without using Interval() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815068#M668269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;Regardless the transformation definition:&lt;/P&gt;&lt;P&gt;Why TIME_1 and TIME_2 are significantly different?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Interval(TIME_SECONDS/86400, 'hh:mm:ss') as TIME_1,&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Interval(TIME_DIV_BY_86400, 'hh:mm:ss') as TIME_2,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Somehow QV know how to round the value correctly?? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2014 13:16:38 GMT</pubDate>
    <dc:creator>vlad_komarov</dc:creator>
    <dc:date>2014-11-12T13:16:38Z</dc:date>
    <item>
      <title>Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815064#M668265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set where some time values are presented in seconds. Data on the chart should be displayed in &lt;STRONG&gt;hh:mm:ss&lt;/STRONG&gt; format.&lt;/P&gt;&lt;P&gt;I've used the Interval() function in the script:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(time_field/86400, 'hh:mm:ss') as TIME_VALUE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and everything was looking good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But,&lt;/P&gt;&lt;P&gt;I need to avoid any data transformation in my script and simply rely on data from the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping that using the same approach on the data side (code from the View Script):&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAST (TIME_SEC / 84600 AS NUMBER (20, 18)) AS TIME_FULL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;will work the same way, but I've noticed some rounding (?) issues.&lt;/P&gt;&lt;P&gt;With small values in seconds, everything looks good:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="time_1.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71046_time_1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;With values growing, the error increases:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="time_2.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71047_time_2.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the difference reaches significant values when time in seconds represent large interval (more than 2 minutes difference in ~1,5 hours range....):&lt;/P&gt;&lt;P&gt;&lt;IMG alt="time_3.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71048_time_3.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could not find any reasonable explanation for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vladimir &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 05:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815064#M668265</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2014-11-12T05:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815065#M668266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is possibly answered here: &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 05:26:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815065#M668266</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-11-12T05:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815066#M668267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/"&gt;http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with tresesco - this is the right source. Especially have a look at Robs comment: avoid using division to convert time.&lt;/P&gt;&lt;P&gt;See also the link above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 05:35:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815066#M668267</guid>
      <dc:creator>danieloberbilli</dc:creator>
      <dc:date>2014-11-12T05:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815067#M668268</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;You want to avoid transforming the data in QV - that's fine. Interval() does not transform the data, it simply formats to hh:mm:ss (or other format that you specify) - the underlying data value is unchanged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can prove this to yourself by entering something like this in a text box:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Num(Interval(3233))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num gets the underlying value...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 05:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815067#M668268</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-11-12T05:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815068#M668269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;Regardless the transformation definition:&lt;/P&gt;&lt;P&gt;Why TIME_1 and TIME_2 are significantly different?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Interval(TIME_SECONDS/86400, 'hh:mm:ss') as TIME_1,&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Interval(TIME_DIV_BY_86400, 'hh:mm:ss') as TIME_2,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Somehow QV know how to round the value correctly?? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 13:16:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815068#M668269</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2014-11-12T13:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815069#M668270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's good article and nice discussion , but it's still not clear for me why QV's Interval() function works better in this case...&lt;/P&gt;&lt;TABLE style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interval(TIME_SECONDS/86400, 'hh:mm:ss') as TIME_1,&amp;nbsp;&amp;nbsp; // result is correct&amp;nbsp; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;Interval(TIME_DIV_BY_86400, 'hh:mm:ss') as TIME_2,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // result is wrong&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Somehow QV know how to round the value correctly??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 13:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815069#M668270</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2014-11-12T13:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Seconds to hh:mm:ss format without using Interval() function</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815070#M668271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excel works perfectly too...&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" width="372"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="text-align: center; vertical-align: baseline;" width="64"&gt;SECONDS&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="158"&gt;SECONDS/86400&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="150"&gt;EXCEL FORMATTED&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top-style: none; text-align: center; vertical-align: baseline;"&gt;5865&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.067881944444444400&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1:37:45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 13:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-Seconds-to-hh-mm-ss-format-without-using-Interval/m-p/815070#M668271</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2014-11-12T13:29:33Z</dc:date>
    </item>
  </channel>
</rss>

