<?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 Converting time to number : hhhh:mm:ss towards number,decimal in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166830#M38636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the Hours:Mins value, you can use subfield and seperate the Hours and Mins first, then u can convery the minutes into its equivalent hour (by dividing it by 60) then adding with Hours.now we will be having the total time in Hours only; so now we can multiply the total Hours time with cost(ensure currency exchange rate is also considered).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this could be the simplest solution for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Mar 2010 15:18:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-03T15:18:06Z</dc:date>
    <item>
      <title>Converting time to number : hhhh:mm:ss towards number,decimal</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166829#M38635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my database I keep person codes, project codes and hours_spent, as well as travel time and a fee/hour.&lt;/P&gt;&lt;P&gt;The format in which the hours_spent spent is stored is hhhh:mm:ss. In order to calculate the cost, you need to sum the hours spent (on a certain project for example) and multiply with the cost / hour.&lt;/P&gt;&lt;P&gt;However, the database field shows for example :&lt;/P&gt;&lt;P&gt;person project code hours spent travel time cost&lt;/P&gt;&lt;P&gt;A 123 25:30:00 01:00:00 45&lt;/P&gt;&lt;P&gt;B 123 5:00:00 45&lt;/P&gt;&lt;P&gt;Total hours spent = 31:30:00. However, you cannot just multiply this field with the cost.&lt;/P&gt;&lt;P&gt;Is there an easy way to convert 31:30:00 towards 31,5 hours&lt;/P&gt;&lt;P&gt;I have also encountered problems when I read the hours_spent field as a time(time#(hours_spent, 'hhhh:mm:ss')) field.&lt;/P&gt;&lt;P&gt;Qlikview stops at 24:00:00. Do I need to convert the database field into another format. So briefly :&lt;/P&gt;&lt;P&gt;=&amp;gt; what is the best way to store an hours spent field that is in database format hhhh:mm:ss in Qlikview&lt;/P&gt;&lt;P&gt;=&amp;gt; how can I quickly convert this into a format which can be used for calculations (multiplying with a cost/hour) for example&lt;/P&gt;&lt;P&gt;Running on QV9 SR2&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 14:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166829#M38635</guid>
      <dc:creator />
      <dc:date>2010-03-03T14:21:42Z</dc:date>
    </item>
    <item>
      <title>Converting time to number : hhhh:mm:ss towards number,decimal</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166830#M38636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the Hours:Mins value, you can use subfield and seperate the Hours and Mins first, then u can convery the minutes into its equivalent hour (by dividing it by 60) then adding with Hours.now we will be having the total time in Hours only; so now we can multiply the total Hours time with cost(ensure currency exchange rate is also considered).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this could be the simplest solution for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 15:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166830#M38636</guid>
      <dc:creator />
      <dc:date>2010-03-03T15:18:06Z</dc:date>
    </item>
    <item>
      <title>Converting time to number : hhhh:mm:ss towards number,decimal</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166831#M38637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work as well:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;interval#(hours_spent,'hhhh:mm:ss')*24&lt;/P&gt;&lt;P&gt;Edit: Answering your questions a little more explicitly...&lt;/P&gt;&lt;P&gt;As you've noticed, time#() can only process times that are less than a day. Basically, it is intended to be a time on a clock, not an elapsed time. To store an elapsed time, use iterval or interval#.&lt;/P&gt;&lt;P&gt;I would suggest storing the data in QlikView as an interval, probably loaded something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;interval(interval#(YourDatabaseField,'hhhh:mm:ss'),'hhhh:mm:ss') as "Time Spent"&lt;/P&gt;&lt;P&gt;The underlying numeric value for an interval is days, so you just multiply by 24 to get hours:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;"Time Spent" * 24 * "Cost Per Hour"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 22:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-time-to-number-hhhh-mm-ss-towards-number-decimal/m-p/166831#M38637</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-03-03T22:55:53Z</dc:date>
    </item>
  </channel>
</rss>

