<?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 Working hours - in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Working-hours/m-p/962526#M957964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, here's a mystery. I'm trying to calculate the working hours between two dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start Time and End Time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;here's the script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interval(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangesum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NetWorkDays(start_time+1,End_time-1,$(vHol)) * MakeTime(10)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if(NetWorkDays(End_time,End_time,$(vHol)),Rangemin(rangemax(frac(End_time),maketime(8)),maketime(18))-Rangemax(rangemin(frac(End_time),maketime(8)),maketime(8)),0) // working hours last day&lt;/P&gt;&lt;P&gt;,if(NetWorkDays(start_time,start_time,$(vHol)),Rangemin(rangemax(frac(start_time),maketime(18)),maketime(18))-Rangemax(rangemin(frac(start_time),maketime(18)),maketime(8)),0) // working hours first day&lt;/P&gt;&lt;P&gt;,if(NetWorkDays(start_time,start_time,$(vHol)) and floor(start_time)=floor(End_time),-MakeTime(10))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;as WorkingHours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Then the Expresion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;WorkingHours&lt;/SPAN&gt;=&amp;nbsp; {"$(='&amp;gt;' &amp;amp; '00:00:00' &amp;amp; '&amp;lt;' &amp;amp; '08:00:00')"}, GroupID={'2'}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="table.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/104478_table.jpg" style="height: 95px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the picture there are some values that aren't fitting into the &amp;lt;8 hours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start = End time is 0 and no clue why, next one is 00:03:05 (far away from 08:00:00) but also doesn't come into &amp;lt;8. Expresion is workin 'cos there are others working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea? some clues?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 15:38:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-09T15:38:05Z</dc:date>
    <item>
      <title>Working hours -</title>
      <link>https://community.qlik.com/t5/QlikView/Working-hours/m-p/962526#M957964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, here's a mystery. I'm trying to calculate the working hours between two dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start Time and End Time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;here's the script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interval(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangesum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NetWorkDays(start_time+1,End_time-1,$(vHol)) * MakeTime(10)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if(NetWorkDays(End_time,End_time,$(vHol)),Rangemin(rangemax(frac(End_time),maketime(8)),maketime(18))-Rangemax(rangemin(frac(End_time),maketime(8)),maketime(8)),0) // working hours last day&lt;/P&gt;&lt;P&gt;,if(NetWorkDays(start_time,start_time,$(vHol)),Rangemin(rangemax(frac(start_time),maketime(18)),maketime(18))-Rangemax(rangemin(frac(start_time),maketime(18)),maketime(8)),0) // working hours first day&lt;/P&gt;&lt;P&gt;,if(NetWorkDays(start_time,start_time,$(vHol)) and floor(start_time)=floor(End_time),-MakeTime(10))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;as WorkingHours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Then the Expresion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;WorkingHours&lt;/SPAN&gt;=&amp;nbsp; {"$(='&amp;gt;' &amp;amp; '00:00:00' &amp;amp; '&amp;lt;' &amp;amp; '08:00:00')"}, GroupID={'2'}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="table.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/104478_table.jpg" style="height: 95px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the picture there are some values that aren't fitting into the &amp;lt;8 hours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start = End time is 0 and no clue why, next one is 00:03:05 (far away from 08:00:00) but also doesn't come into &amp;lt;8. Expresion is workin 'cos there are others working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea? some clues?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 15:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-hours/m-p/962526#M957964</guid>
      <dc:creator />
      <dc:date>2015-11-09T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Working hours -</title>
      <link>https://community.qlik.com/t5/QlikView/Working-hours/m-p/962527#M957965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks to me that you're comparing an interval value with strings. I doubt that is correct. Perhaps this works better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM({$&amp;lt;WorkingHours=&amp;nbsp; {"&amp;gt;=$(=Time(MakeTime(0)))&amp;lt;$(=Time(MakeTime(8)))"}, GroupID={'2'}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that also does not work then please post a small qlik sense app that demonstrates the problem.&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 10:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-hours/m-p/962527#M957965</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-11-10T10:21:10Z</dc:date>
    </item>
  </channel>
</rss>

