<?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 Decimal to Seconds in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624968#M229906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabrice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your solution works best if I keep Replace(responseTime,'.',',') in LOAD.&lt;/P&gt;&lt;P&gt;However, there is a problem with the rounding. It doesn't take into account the first decimal digit and 99.99.. is 1:39 instead of 1:40. Any ideas about that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivelin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2014 15:45:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-11T15:45:57Z</dc:date>
    <item>
      <title>Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624963#M229901</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 want to convert decimal numbers, in the form of 70.345678901234 (seconds), into mm:ss. I found some solutions in the forums and tried quite a few but still can't figure out what I'm doing wrong. I also tried changing the &lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;decimal &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;separator&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt; and shortening the numbers to less than 14-digits.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help with that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ivelin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:01:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624963#M229901</guid>
      <dc:creator />
      <dc:date>2014-03-11T15:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624964#M229902</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 can use timestamp()&lt;/P&gt;&lt;P&gt;like this,&lt;/P&gt;&lt;P&gt;=Timestamp(date,'mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624964#M229902</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2014-03-11T15:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624965#M229903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, try this:&lt;/P&gt;&lt;P&gt;In your script, in the load statement, write &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;instead&lt;/STRONG&gt;&lt;/SPAN&gt; of your field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;timestamp(timestamp#(&lt;STRONG&gt;round(&lt;/STRONG&gt;Your Field&lt;STRONG&gt;)&lt;/STRONG&gt;,'mm:ss'),'mm:ss') as New Field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Lucas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Fabrice made a very good point, changes are in bold&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624965#M229903</guid>
      <dc:creator />
      <dc:date>2014-03-11T15:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624966#M229904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the &lt;STRONG&gt;time&lt;/STRONG&gt;() function and &lt;STRONG&gt;round&lt;/STRONG&gt;() also to remove some digits&lt;/P&gt;&lt;P&gt;1 day = 1, 12 hrs= 0,5&lt;/P&gt;&lt;P&gt;so if your field is expressed in seconds, you will need to divide by 3600*24&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sth like &lt;STRONG&gt;time&lt;/STRONG&gt;(YourField/3600/24, 'hh:mm:ss') as YourFiled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624966#M229904</guid>
      <dc:creator />
      <dc:date>2014-03-11T15:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624967#M229905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date, responseTime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140101, 12.72959423502355&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140110, 13.28933262233888&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140120, 99.99893392359389&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140131, 11.18933455334568&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '00:00:'&amp;amp;responseTime as Test&lt;/P&gt;&lt;P&gt;Resident T1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then format your new field to be represented as Time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Antoine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624967#M229905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-11T15:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624968#M229906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabrice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your solution works best if I keep Replace(responseTime,'.',',') in LOAD.&lt;/P&gt;&lt;P&gt;However, there is a problem with the rounding. It doesn't take into account the first decimal digit and 99.99.. is 1:39 instead of 1:40. Any ideas about that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivelin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624968#M229906</guid>
      <dc:creator />
      <dc:date>2014-03-11T15:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624969#M229907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did not recommend to use replace()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try to use the &lt;STRONG&gt;round&lt;/STRONG&gt;() function : &lt;STRONG&gt;time(round(seconds, 1)/24/3600, 'hh:mm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You are right, the time() function does not round the seconds, it takes the integer part (like floor() function)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624969#M229907</guid>
      <dc:creator />
      <dc:date>2014-03-11T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Decimal to Seconds</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624970#M229908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now it works perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for replace(), If I don't use it then time() in expressions returns null. That's also the case with Lucas' solution. I guess it's a conflict with the decimal separators..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivelin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Decimal-to-Seconds/m-p/624970#M229908</guid>
      <dc:creator />
      <dc:date>2014-03-11T16:14:53Z</dc:date>
    </item>
  </channel>
</rss>

