<?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 Re: Networkdays Calculation - Exact Decimals Required in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275927#M859609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try (exclude the first and the last then add the time part of the first and the last)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NetWorkDays(d1, d2) -2 + &lt;STRONG&gt;(1-frac(d1)) + frac(d2)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Maybe you have add a check for holidays in the bold part&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 18:50:43 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2017-01-19T18:50:43Z</dc:date>
    <item>
      <title>Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275922#M859604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you can help with this one please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have what I thought was a simple query, but after scouring the community page, no-one else seems to be asking this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I work in a business where we want to calculate the exact number of working days between a 'StartDateTime' and an 'EndDateTime', taking holidays into account.&amp;nbsp; However because this is driving KPI reporting, we want to be exact. Networkdays isn't doing it for me....here are some details of my experience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how I currently approached it.&amp;nbsp; Due to the requirement to manage weekdays and holidays, I started with the following function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(date_ordered, DateCompleted, $(vStatHols)) as WorkDaysToComplete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....however of course, I only get a whole number returned using this function.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Example - one order looked like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;date_ordered =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5/01/2015 11:51:36 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DateCompleted =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7/01/2015 10:28:13 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Networkdays =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The actual correctly calculated working days is 1.942 days.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference from a KPI performance perspective is quite significant (1.058 days) and it magnifies once you spread that logic across a year of order processing and customer reporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also need the function to round up and down the exact result.........so in the above, it would of course be 2 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can assist me in how I can achieve this, I would really appreciate it.&amp;nbsp; I don't know what other function will allow the calculation of working days and holidays other than networkdays.&amp;nbsp; Hoping there is an easy solution to get the exact decimal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Giles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275922#M859604</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275923#M859605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Giles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Network days gives difference in days only not with decimal points.&lt;/P&gt;&lt;P&gt;If you are looking for exact days difference with decimal points than you should go with datediff or simple date1-date2 formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 06:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275923#M859605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-19T06:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275924#M859606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Pooja, but this is not a workable solution for my requirement.&amp;nbsp; I am using QlikSense, so the datediff function will not work there, and the simple &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date1-date2&lt;/SPAN&gt; scenario doesn't dynamically take weekends and holiday dates into account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275924#M859606</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T18:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275925#M859607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try using Num(yourexpresssion, '#0.00')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275925#M859607</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-01-19T18:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275926#M859608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion, however on testing this doesn't work either.&amp;nbsp; It still returns the same number of working days, just with the decimal on the end, e.g. what was showing as 3, is now showing as 3.00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275926#M859608</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T18:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275927#M859609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try (exclude the first and the last then add the time part of the first and the last)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NetWorkDays(d1, d2) -2 + &lt;STRONG&gt;(1-frac(d1)) + frac(d2)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Maybe you have add a check for holidays in the bold part&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275927#M859609</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-01-19T18:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275928#M859611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimo - you are a legend!&amp;nbsp; This is exactly what I need!!&amp;nbsp; Wow!&amp;nbsp; Awesome.&amp;nbsp; Thanks so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just 1 question on the NetWorkDays function, do you think it will be ok to insert my holidays variable, i.e. to go from your example of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NetWorkDays(d1, d2) -2 + (1-frac(d1)) + frac(d2)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;....to:&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NetWorkDays(d1, d2, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;$(vStatHols)&lt;/STRONG&gt;&lt;/SPAN&gt;) -2 + &lt;/EM&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(1-frac(d1)) + frac(d2)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thanks again Massimo &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Giles&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 19:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275928#M859611</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T19:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275929#M859614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think you're right, add the holidays to the networkdays function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275929#M859614</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-01-19T20:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275930#M859616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Massimo, mate you are right on the money my friend.&amp;nbsp; Its working - great!!!&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 21:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275930#M859616</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T21:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275931#M859618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF you think few of the replies and of Massimo's are correct mark them helpful. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 21:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275931#M859618</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-01-19T21:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275932#M859619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you might need to consider the case where d1 and d2 are on the same date differently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And maybe also if d1 or d2 can be a holiday / weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this more general approach taking business hours into account (which you can simplify a lot if you don't care about business hours):&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/60227"&gt;Calculate hours between two Date/Time strings&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 21:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275932#M859619</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-01-19T21:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275933#M859620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The mentioned simplified version might look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;Interval(&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;rangesum(&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;NetWorkDays(DT1+1,DT2-1,$(vHol)) *1 &lt;/EM&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;// 24 hours per workday, for all days inbetween the period, excluding bounderies&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;,if(NetWorkDays(DT2,DT2,$(vHol)), frac(DT2),0)&amp;nbsp; // working hours last day&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;,if(NetWorkDays(DT1,DT1,$(vHol)),1-frac(DT1),0) // working hours first day&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;,if(NetWorkDays(DT1,DT1,$(vHol)) and floor(DT1)=floor(DT2),-1)&amp;nbsp; // correct for first equals last day&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 21:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275933#M859620</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-01-19T21:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275934#M859621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan, I will give your simplified version a try.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your earlier link, I just used the below (in bold) and it was almost ok -but there was an inconsistent result when a &lt;SPAN style="font-size: 13.3333px;"&gt;DateCompleted&lt;/SPAN&gt; matched a vHol date.&amp;nbsp; Some calculated correctly but some were wrong.....however all instances of &lt;SPAN style="font-size: 13.3333px;"&gt;DateCompleted&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; matching &lt;/SPAN&gt;weekend dates produced accurate results...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Interval((RangeMin(frac(DateCompleted)) - RangeMax(frac(date_ordered)))) + (NetWorkDays(date_ordered, DateCompleted-1, $(vStatHols)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway I will look at your simplified suggestion now and let you know how I get on.&amp;nbsp; I appreciate your involvement on helping with this and I will update to "correct answer" once I have concluded it works ok.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 22:56:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275934#M859621</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T22:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275935#M859622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your solution, and it doesn't satisfy my requirement, but I think I know why.&amp;nbsp; I implemented the code, and reconciled the scenario where the &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DateCompleted&lt;/STRONG&gt; falls on a weekend.&amp;nbsp; The way I read my data output is that your code calculates the exact period from the &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;date_ordered&lt;/STRONG&gt; &lt;SPAN style="text-decoration: underline;"&gt;until&lt;/SPAN&gt; the weekend &lt;SPAN style="text-decoration: underline;"&gt;starts&lt;/SPAN&gt;, which is not quite what I need, and I think this is where I conclude that my explanation has been deficient in detail.&amp;nbsp; So please let me expand on my requirement, and maybe it will become clearer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The operation I work in receives client orders and performs a pick, pack &amp;amp; ship function, shipping items to end users/retailers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Orders are only RECEIVED during Monday-Friday weekdays (causing &lt;STRONG&gt;date_ordered&lt;/STRONG&gt; to be triggered),&amp;nbsp; and orders are normally closed (triggering &lt;STRONG&gt;DateCompleted&lt;/STRONG&gt;) during those week days too - this closure may be on the same day or the next day (etc) as the &lt;STRONG&gt;date_ordered&lt;/STRONG&gt;, dependent on the desired service.&amp;nbsp; I am measuring the period between &lt;STRONG&gt;date_ordered&lt;/STRONG&gt; and &lt;STRONG&gt;DateCompleted&lt;/STRONG&gt;, and need the exact period of time in days, not just Networkdays.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the order is to be closed the next working day, it must be noted that Friday's orders would be closed on the following Monday, requiring Saturday and Sunday to be excluded from the working days calculations.&amp;nbsp; I also have to consider known holidays which can further extend the order processing period.&amp;nbsp; HOWEVER, exceptionally busy periods could see the business require staff to work weekends and even holiday dates to close those orders, so it is possible to see &lt;STRONG&gt;DateCompleted&lt;/STRONG&gt; during weekend and holiday dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the function needs to cover both scenarios ie:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Where the orders are closed during week days (some spanning a weekend)&lt;/LI&gt;&lt;LI&gt;Where orders are closed on weekends and holidays.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are able to help further I would appreciate it - I am finding this quite complex to resolve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 23:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275935#M859622</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-19T23:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275936#M859623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After deliberating the best means to move forward, I decided to change tactic as the formulas were getting too complex for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also discovered that I had some orders with &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;date_ordered &lt;/STRONG&gt;dates that were not on weekdays which made things more complex still.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I decided that the best thing to do was to 'normalise' the transaction dates, using the '&lt;STRONG&gt;lastworkdate&lt;/STRONG&gt;' function inside an &lt;STRONG&gt;IF&lt;/STRONG&gt; statement, effectively pushing all the transactions that happened on weekends of holidays into the next available working day.&amp;nbsp; That way I could make a more simple formula to get my result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;For anything with &lt;STRONG&gt;date_ordered&lt;/STRONG&gt; on weekends, the &lt;STRONG&gt;IF&lt;/STRONG&gt; statement and '&lt;STRONG&gt;lastworkdate&lt;/STRONG&gt;' function were used to re-stamp those dates as the next working day at 8am i.e:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date(LastWorkDate(date_ordered+1, 1,$(vStatHols)) + time('08:00:00', 'hh:mm:ss TT'), 'D/MM/YYYY hh:mm:ss TT') as date_ordered_Corrected&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To support this I also used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Weekday(date_ordered) as date_ordered_Name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I used a preceeding load to calculate this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Match(date_ordered_Name, 'Sat', 'Sun') &amp;gt;0, date_ordered_Corrected, If(Match(date_ordered, $(vStatHols)) &amp;gt; 0, date_ordered_Corrected, date_ordered)) as Final_Corrected_Date_Ordered&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also did basically the same for anything '&lt;STRONG&gt;DateCompleted&lt;/STRONG&gt;', although the 'time' function added in was timestamped as the below, meaning that the 'adjusted' &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;DateCompleted&lt;/STRONG&gt;&lt;/SPAN&gt; was just inside the next available working day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+ time('00:00:01', 'hh:mm:ss TT')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in another preceeding load I scripted the below which gives the exact period of days with any relevant decimals:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Interval((RangeMin(frac(Final_Corrected_DateCompleted)) - RangeMax(frac(Final_Corrected_Date_Ordered)))) + (NetWorkDays(Final_Corrected_Date_Ordered, Final_Corrected_DateCompleted-1, $(vStatHols))) as WorkDaysToCompleteExact&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am pleased to report that this provides the correct data per my requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 01:46:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275936#M859623</guid>
      <dc:creator>gileswalker</dc:creator>
      <dc:date>2017-01-23T01:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275937#M859624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Massimo- I know this is a year old- but can/would you explain what the -2 is doing? and if the time is in d1 and d2 why should I add it back in?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NetWorkDays(d1, d2) -2 + (1-frac(d1)) + frac(d2)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2018 15:52:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275937#M859624</guid>
      <dc:creator>ellyodelly</dc:creator>
      <dc:date>2018-01-25T15:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275938#M859625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanQ for your help with this,&lt;/P&gt;&lt;P&gt;Clive Spindley&lt;/P&gt;&lt;P&gt;NHS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 15:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1275938#M859625</guid>
      <dc:creator>cspindley</dc:creator>
      <dc:date>2018-05-18T15:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1538695#M859628</link>
      <description>&lt;P&gt;Having the same issue however for my case would need to include weekends into the equation as well.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 10:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1538695#M859628</guid>
      <dc:creator>Keitaru</dc:creator>
      <dc:date>2019-02-02T10:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1577540#M859629</link>
      <description>Even I am trying to understand the logic behind the expression.</description>
      <pubDate>Tue, 07 May 2019 15:24:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1577540#M859629</guid>
      <dc:creator>vsap2000</dc:creator>
      <dc:date>2019-05-07T15:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays Calculation - Exact Decimals Required</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1652169#M859630</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;NetWorkDays([Start Datetime], [EndDatetime]
-IF(NetWorkDays([Start Datetime], [Start Datetime])&amp;gt;0,1,0)*interval([Start Datetime] - Floor([Start Datetime]), 'd')
-IF(NetWorkDays([End Datetime], [End Datetime])&amp;gt;0,1,0)*interval(Ceil([End Datetime]) - [End Datetime], 'd')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming [Start Datetime] &amp;lt;= [End Datetime],&lt;BR /&gt;would the above work? My approach is to minus the "tail end" hours of the period from the network days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 09:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-Calculation-Exact-Decimals-Required/m-p/1652169#M859630</guid>
      <dc:creator>crispali</dc:creator>
      <dc:date>2019-11-28T09:41:47Z</dc:date>
    </item>
  </channel>
</rss>

