<?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: Get Number of days excluding Friday and holidays in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264725#M398535</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;SPAN style="font-size: 13.3333px;"&gt;you can build the holidays table using an autonumber generation calendar or using an existing table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HolidayCalendar:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this build a string with dates in "" and comma separated style&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Chr(39) &amp;amp; Replace(Concat(date(Holiday),','),',',chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39) as HolidayList&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //suppose to have a table with a list of Holidays with a single field called "Holiday" (with fridays too)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Holidays.qvd(qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //suppose needing only the last 2 years...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE Year(Holiday)&amp;gt;=(year(today())-1) and Year(Holiday)&amp;lt;=year(today())&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vHolidayList = Peek('HolidayList',0,'HolidayCalendar');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE HolidayCalendar;&lt;/STRONG&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;Cell Formula:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;=networkdays(StartDate, EndDate, $(&lt;SPAN style="font-size: 13.3333px;"&gt;vHolidayList&lt;/SPAN&gt;))&lt;/STRONG&gt;&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;&lt;BR /&gt;&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2017 16:33:34 GMT</pubDate>
    <dc:creator>Marcoimp</dc:creator>
    <dc:date>2017-01-31T16:33:34Z</dc:date>
    <item>
      <title>Get Number of days excluding Friday and holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264724#M398534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Dear Concerned,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I am trying to get the number of days between the two below dates "DC Order Date" and "DC Pcik Date" and exclude Fridays and holidays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/151445_pastedImage_0.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Any idea if doable using the networkdays function or i have to use another function.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Please advise.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;A href="https://community.qlik.com/qlik-users/55815"&gt;ali_hijazi&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 15:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264724#M398534</guid>
      <dc:creator>elie_issa</dc:creator>
      <dc:date>2017-01-31T15:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get Number of days excluding Friday and holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264725#M398535</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;SPAN style="font-size: 13.3333px;"&gt;you can build the holidays table using an autonumber generation calendar or using an existing table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HolidayCalendar:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this build a string with dates in "" and comma separated style&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Chr(39) &amp;amp; Replace(Concat(date(Holiday),','),',',chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39) as HolidayList&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //suppose to have a table with a list of Holidays with a single field called "Holiday" (with fridays too)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Holidays.qvd(qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //suppose needing only the last 2 years...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE Year(Holiday)&amp;gt;=(year(today())-1) and Year(Holiday)&amp;lt;=year(today())&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vHolidayList = Peek('HolidayList',0,'HolidayCalendar');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE HolidayCalendar;&lt;/STRONG&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;Cell Formula:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;=networkdays(StartDate, EndDate, $(&lt;SPAN style="font-size: 13.3333px;"&gt;vHolidayList&lt;/SPAN&gt;))&lt;/STRONG&gt;&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;&lt;BR /&gt;&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 16:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264725#M398535</guid>
      <dc:creator>Marcoimp</dc:creator>
      <dc:date>2017-01-31T16:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get Number of days excluding Friday and holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264726#M398536</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;How about the below approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/151488_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Since Monday is 1 and Friday is 5 in QlikView, and you want to exclude Fridays and holidays. Then we can add 1 to the begin date and deduct 1 from the end date to come up with the exact working days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only tested for a few date ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was also another thread regarding to this. Although, the approach in the below thread didn't work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/469333"&gt;Re: Get num of days between 2 dates&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 19:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264726#M398536</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2017-01-31T19:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get Number of days excluding Friday and holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264727#M398537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;But in this case you are excluding also saturday and Sunday.&lt;/P&gt;&lt;P&gt;I need to count Saturday and Sunday and exclude Friday and holidays.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 07:59:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264727#M398537</guid>
      <dc:creator>elie_issa</dc:creator>
      <dc:date>2017-02-01T07:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get Number of days excluding Friday and holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264728#M398538</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;create an island table for working dates with 2 fields: WK_Date and WorkingDay (1= working, 0= Weekend or Holiday), and populate your entire calendar table in it while filling the &lt;SPAN style="font-size: 13.3333px;"&gt;WorkingDay.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152274_Capture.JPG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and in the expression of the date difference field, use the following:&lt;/P&gt;&lt;P&gt;sum(if(WK_Date &amp;gt;= [DC Order Date] and WK_Date &amp;lt;= [DC Pcik Date], WorkingDay))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 10:35:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Number-of-days-excluding-Friday-and-holidays/m-p/1264728#M398538</guid>
      <dc:creator>hani_saghir</dc:creator>
      <dc:date>2017-02-07T10:35:41Z</dc:date>
    </item>
  </channel>
</rss>

