<?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: How to check the number of public holidays days found between 2 dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767480#M272614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hasnaa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking to do this in the script have a look at the networkdays function. If you have a list of holidays, you can plug this in to the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Networkdays([date_in],[date_out])&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Networkdays([date_in],[date_out], [your list of holidays here]) ) As Holiday_counter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example, the first function gives you all working days between the range, then used again you can exclude your defined holiday list, the net of the two is the number of holidays that fall between the dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2014 09:00:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-18T09:00:54Z</dc:date>
    <item>
      <title>How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767478#M272612</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;I have 2 dates, date_In and date_Out. I also have a list of bank holidays appended in a list ('holiday1,holiday2,holiday3')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if there is a way to calculate in the script how many public holidays there are between date_in and date_out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hasnaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 08:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767478#M272612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T08:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767479#M272613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried NetWorkDays()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 08:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767479#M272613</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-11-18T08:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767480#M272614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hasnaa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking to do this in the script have a look at the networkdays function. If you have a list of holidays, you can plug this in to the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Networkdays([date_in],[date_out])&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Networkdays([date_in],[date_out], [your list of holidays here]) ) As Holiday_counter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example, the first function gives you all working days between the range, then used again you can exclude your defined holiday list, the net of the two is the number of holidays that fall between the dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767480#M272614</guid>
      <dc:creator />
      <dc:date>2014-11-18T09:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767481#M272615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Networkdays will actually calculate the difference between the two days. I have tried and it is not even excluding the holodays. What I really need is to get only the number of holidays that falls between the two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hasnaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:01:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767481#M272615</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T09:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767482#M272616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Networkdays is not taking into consideration holidays &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767482#M272616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T09:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767483#M272617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to add the optional parameter for holidays like I said&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:16:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767483#M272617</guid>
      <dc:creator />
      <dc:date>2014-11-18T09:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767484#M272618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way could be like, create multiple dates using SubField() like:&lt;/P&gt;&lt;P&gt;HDays:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date#(SubField(PurgeChar(HolidayDates, chr(39)), ','), 'MM/DD/YYYY') as Holidays&lt;/P&gt;&lt;P&gt;From &amp;lt;&amp;gt;;&lt;/P&gt;&lt;P&gt;Then use cross join this table with rest of the table. Then you would get all the holidays against each of the date combination(in and out). Then you just have to compare them with simple IF like:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(If(InDate&amp;lt;=Holidays and outDate&amp;gt;=Holidays,1)) as Count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or may be you can try with intervalmatch() as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767484#M272618</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-11-18T09:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767485#M272619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should add, you'll want to put your holiday list into a variable and use that as the holiday optional parameter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:23:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767485#M272619</guid>
      <dc:creator />
      <dc:date>2014-11-18T09:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767486#M272620</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;Thats what I did. However, the network days function is not taking into consideration the holidays. I used the following in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimeFormat='hh:mm:ss';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='MM/DD/YYYY hh:mm:ss[.fff]';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Returns_Date:&lt;/P&gt;&lt;P&gt;LOAD _Id_Operator AS OPERATOR_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Return_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time_In, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time_Out&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is [Sheet1$]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpHoliday :&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; OPERATOR_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([WORKINGDAY]='N',Date([CALDATE])) as Date&lt;/P&gt;&lt;P&gt;FROM &lt;/P&gt;&lt;P&gt;&amp;nbsp; $(v_QVD)$(v_qvd_calendar)(qvd); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpConcat :&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; OPERATOR_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; concat(chr(39) &amp;amp; Date &amp;amp; chr(39),',') as HolidayDates&lt;/P&gt;&lt;P&gt;RESIDENT &lt;/P&gt;&lt;P&gt;&amp;nbsp; tmpHoliday&lt;/P&gt;&lt;P&gt;&amp;nbsp; GROUP BY OPERATOR_CODE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join(tmpConcat)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; OPERATOR_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Return_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time_In, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time_Out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident Returns_Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;NetWorkDays(Time_In, Time_Out) as `TAT NOholiday`,&lt;/P&gt;&lt;P&gt;NetWorkDays(Time_In, Time_Out, HolidayDates) as `TAT holiday`&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT&amp;nbsp; tmpConcat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Time_In and Time_Out are in the format 'MM/DD/YYYY hh:mm:ss'.&amp;nbsp; The holidays are in the format &lt;STRONG&gt; 'MM/DD/YYYY'. Could this be the issue?&lt;/STRONG&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;Kindly advise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hasnaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767486#M272620</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T09:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767487#M272621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I would also date your time fields in the network days and see how that goes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also is there a need to join in like that? Do the holiday dates differ per operator_code? If not I would load that list as a variable from the temp table and use that as the parameter, to save the need of the join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 10:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767487#M272621</guid>
      <dc:creator />
      <dc:date>2014-11-18T10:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767488#M272622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The holidays are different for several countries, in this case operator. I even use date in the script but then networkdays does not work at all. It is not excluding holidays &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; . please see image attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/71513_Capture.PNG" style="width: 620px; height: 207px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 10:43:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767488#M272622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T10:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767489#M272623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm, not sure if network days will work for you in that case, with a shifting third parameter like that. Think the only way to use it in your case, would be to loop through each of the operator codes in turn, rather than a full load, that should work for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 13:10:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767489#M272623</guid>
      <dc:creator />
      <dc:date>2014-11-18T13:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767490#M272624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;been quite busy, but the attached might help you, not been able to test it, so a bit of blind coding, so forgive the errors!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 14:00:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767490#M272624</guid>
      <dc:creator />
      <dc:date>2014-11-19T14:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to check the number of public holidays days found between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767491#M272625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you help. I will check it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 05:16:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-the-number-of-public-holidays-days-found-between-2/m-p/767491#M272625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-20T05:16:55Z</dc:date>
    </item>
  </channel>
</rss>

