<?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 Date Difference in Hours in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814585#M287309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; Qlikers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to know how to get the difference between two dates in hours but without counting weekends, example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date A: 01/12/2014 08:16:54.000&lt;/P&gt;&lt;P&gt;Date B: 28/11/2014 09:31:11.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Real Difference: 71 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Difference: 25 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody can help me??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos Martinez&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 16:49:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-19T16:49:44Z</dc:date>
    <item>
      <title>Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814585#M287309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; Qlikers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to know how to get the difference between two dates in hours but without counting weekends, example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date A: 01/12/2014 08:16:54.000&lt;/P&gt;&lt;P&gt;Date B: 28/11/2014 09:31:11.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Real Difference: 71 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Difference: 25 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody can help me??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos Martinez&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 16:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814585#M287309</guid>
      <dc:creator />
      <dc:date>2015-01-19T16:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814586#M287310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;time&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date A]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;lastWorkDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date B]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,2), 'DD/MM/YYYY hh:mm:ss[.fff]') ,'hh:mm')+&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FirstWorkDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date A]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,2)&amp;amp;' 23:59:59' ,'DD/MM/YYYY hh:mm:ss[.fff]')-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date B]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'hh:mm'),'hh') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;From 09:31 of 28/11 to the end of day are 14,5 hours + from 00:00 of 01/12 to 08:16 are 8. I calculated 22 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814586#M287310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-19T17:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814587#M287311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the NetWorkDays Function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(NetWorkDays(DateB,DateA)-2)*24 + 24-Hour(DateB) + Hour(DateA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or for an exact calculation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(NetWorkDays(DateB,DateA)-2)*24 + 24-Frac(DateB)*24 + Frac(DateA)*24&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:53:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814587#M287311</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2015-01-19T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814588#M287312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply but i put your formula on my chart and it doesn't display anything, maybe you have a mistake on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:56:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814588#M287312</guid>
      <dc:creator />
      <dc:date>2015-01-19T17:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814589#M287313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answer Works thank you, but now i have another question, what i have to include in the formula you gave me to skip some defined days?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date A: 26/12/2014 09:02:17&lt;/P&gt;&lt;P&gt;Date B: 24/12/2014 11:28:16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With formula:&lt;/P&gt;&lt;P&gt;45.57 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Result skipping 25/12/2014:&lt;/P&gt;&lt;P&gt;21 hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 18:13:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814589#M287313</guid>
      <dc:creator />
      <dc:date>2015-01-19T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814590#M287314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can call the NetWorkDays function with defined holidays as additional parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(StartDate,EndDate,Holyday1,Holiday2,...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(DateB,DateA,'25/12/2014')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 18:41:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814590#M287314</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2015-01-19T18:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814591#M287315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply it Works, but can NetWorkDays use instead Holiday1, Holiday2.... a variable with some days?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 19:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814591#M287315</guid>
      <dc:creator />
      <dc:date>2015-01-19T19:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference in Hours</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814592#M287316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at John Witherspoon reply on this thread, I used it once and worked like a charm:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/94929#94929" title="http://community.qlik.com/message/94929#94929"&gt;http://community.qlik.com/message/94929#94929&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Ernesto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 20:18:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Difference-in-Hours/m-p/814592#M287316</guid>
      <dc:creator>consenit</dc:creator>
      <dc:date>2015-01-19T20:18:01Z</dc:date>
    </item>
  </channel>
</rss>

