<?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 Time Intervals excluding weekends in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192060#M53887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've searched high and low on the forums and haven't seen any similar questions asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is to be able to measure the time interval between 2 timestamps, excluding weekends. So, the distance between friday at noon to sunday at noon would be 24 hours instead of 72.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm aware of the networkdays() function, but that is only precise down to the number of days and not the number of hours. Dividing it by 24 wouldnt give me the precision I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody run across this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Jan 2011 17:37:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-01-28T17:37:43Z</dc:date>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192060#M53887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've searched high and low on the forums and haven't seen any similar questions asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is to be able to measure the time interval between 2 timestamps, excluding weekends. So, the distance between friday at noon to sunday at noon would be 24 hours instead of 72.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm aware of the networkdays() function, but that is only precise down to the number of days and not the number of hours. Dividing it by 24 wouldnt give me the precision I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody run across this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 17:37:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192060#M53887</guid>
      <dc:creator />
      <dc:date>2011-01-28T17:37:43Z</dc:date>
    </item>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192061#M53888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i'm not sure if this will help you, but can be a first step to the solution&lt;/P&gt;&lt;P&gt;If we have (Feb 2nd 2011 - Jan 28th 2011) = 4 days&lt;/P&gt;&lt;P&gt;but, you can substract 2 days for every 7 days of difference, i mean this&lt;/P&gt;&lt;P&gt;(Feb 2nd 2011- Jan 28th 2011) - (ceil((Feb 2nd 2011- Jan 28th 2011)/7)*2) =&amp;gt; 4 - (ceil(4/7) * 2) = &amp;gt; 4 - (1*2) =&amp;gt; 2&lt;/P&gt;&lt;P&gt;so summing upl for every 7 days of difference, you need to substract 2 days (Sat and Sun)&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 18:34:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192061#M53888</guid>
      <dc:creator>hector</dc:creator>
      <dc:date>2011-01-28T18:34:09Z</dc:date>
    </item>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192062#M53889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hector,&lt;/P&gt;&lt;P&gt;Thanks for the reply. That's certainly a good thought but it leaves me short of my goal in a couple ways:&lt;/P&gt;&lt;P&gt;1. What if the date interval doesn't include a weekend? Friday at noon to Friday at 5PM, for example.&lt;/P&gt;&lt;P&gt;2. It still does not get me down to an hour level precision.&lt;/P&gt;&lt;P&gt;If only they had a networktimestamp() function that work similarly to networkdays() but gave the time interval excluding weekends rather than the days...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 18:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192062#M53889</guid>
      <dc:creator />
      <dc:date>2011-01-28T18:51:41Z</dc:date>
    </item>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192063#M53890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again&lt;/P&gt;&lt;P&gt;Answering your question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;mg119888 wrote:&lt;BR /&gt;1. What if the date interval doesn't include a weekend? Friday at noon to Friday at 5PM, for example. &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;So, you need to control the week number, with the week function, if they are different, includes 1 weekend&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;mg119888 wrote:&lt;BR /&gt;2. It still does not get me down to an hour level precision.&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;There are 2 options, interval(timestamp2 - timestamp1,'hh') will return the difference in hours&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;(timestamp2 - timestamp1) *24 will return the difference in hours but numeric&lt;/P&gt;&lt;P&gt;Any way, try this example and tell us&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 19:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192063#M53890</guid>
      <dc:creator>hector</dc:creator>
      <dc:date>2011-01-28T19:17:59Z</dc:date>
    </item>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192064#M53891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant! Thank you sir. Exactly what I was looking for.&lt;/P&gt;&lt;P&gt;Only one problem left - start and end dates CAN occur on weekends, so I need to somehow roll all weekend dates into Friday and/or Monday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 20:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192064#M53891</guid>
      <dc:creator />
      <dc:date>2011-01-28T20:06:12Z</dc:date>
    </item>
    <item>
      <title>Time Intervals excluding weekends</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192065#M53892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;P&gt;You can check what day is (Mon - Sun) with weekday(), this is a dual function, so has numbers from Mon =0 to Sun = 6,&lt;/P&gt;&lt;P&gt;so if your date is Sat (6), will be &lt;B&gt;yourdate - 1 (Friday)&lt;/B&gt;, and in the other case you can sum days to move from Sat to Mon&lt;/P&gt;&lt;P&gt;Rgds and good luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 20:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-excluding-weekends/m-p/192065#M53892</guid>
      <dc:creator>hector</dc:creator>
      <dc:date>2011-01-28T20:27:52Z</dc:date>
    </item>
  </channel>
</rss>

