<?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 Elapsed Time by Day, Across Multiple Days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348128#M493532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can do it just like I posted here, using a while loop to iterate over the days in your intervals and a complicated-looking conditional to calculate the hours for eah single day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/152379#152379"&gt;http://community.qlik.com/message/152379&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 May 2012 22:59:28 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-05-11T22:59:28Z</dc:date>
    <item>
      <title>Elapsed Time by Day, Across Multiple Days</title>
      <link>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348126#M493530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a simple data set that looks like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sorry, but the "Insert Table" function isn't working for me.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AccountNumber&amp;nbsp;&amp;nbsp; StartDateTime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDateTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A123456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2012 16:00&amp;nbsp;&amp;nbsp; 1/1/2012 18:25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A123457&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2012 16:00&amp;nbsp;&amp;nbsp; 1/2/2012 08:15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;A123458&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2012 16:00&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/3/2012 14:45&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;I need to be able to calculate the number of hours for each day.&amp;nbsp; In this example, the daily totals would be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;1/1/2012 = 18.42 hours&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;1/2/2012 = 32.25 hours&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;1/3/2012 = 14.75 hours&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;I'm sure I'm not the first one to encounter this type of issue.&amp;nbsp; Would this be done in the script, in the expression, or a combination of the two?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Thanks. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 18:25:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348126#M493530</guid>
      <dc:creator />
      <dc:date>2012-05-11T18:25:57Z</dc:date>
    </item>
    <item>
      <title>Elapsed Time by Day, Across Multiple Days</title>
      <link>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348127#M493531</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;I would do it in the script load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;AccountNumber,&lt;/P&gt;&lt;P&gt;StartDateTime, &lt;/P&gt;&lt;P&gt;EndDateTime,&lt;/P&gt;&lt;P&gt;If(Day(StartDateTime)=Day(EndDateTime),EndDateTime-StartDateTime,Floor(EndDateTime)-StartDateTime) as Hours_Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don´t know if Floor(EndDateTime)-StartDateTime will work but If won´t work is because the types of the dates are different. I think this is the best way to get what you want but probably are better options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 20:52:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348127#M493531</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-05-11T20:52:23Z</dc:date>
    </item>
    <item>
      <title>Elapsed Time by Day, Across Multiple Days</title>
      <link>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348128#M493532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can do it just like I posted here, using a while loop to iterate over the days in your intervals and a complicated-looking conditional to calculate the hours for eah single day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/152379#152379"&gt;http://community.qlik.com/message/152379&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 22:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Elapsed-Time-by-Day-Across-Multiple-Days/m-p/348128#M493532</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-11T22:59:28Z</dc:date>
    </item>
  </channel>
</rss>

