<?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 How to Get NetworkDays excluding Sunday and holidays in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-Get-NetworkDays-excluding-Sunday-and-holidays/m-p/2126470#M91673</link>
    <description>&lt;P&gt;Hi, Fellow Qlikkers&lt;/P&gt;
&lt;P&gt;Below is a modified script for getting the network days without saturday and non-working-days (holidays)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SET vFirstDate = date#('2023-01-01','YYYY-MM-DD');&lt;BR /&gt;SET vLastDate = date#('2024-01-01','YYYY-MM-DD');&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Holidays of the year List&lt;BR /&gt;Holidays:&lt;BR /&gt;mapping LOAD date#(Date,'YYYY-MM-DD') as Date,1 INLINE [&lt;BR /&gt;Date&lt;BR /&gt;2023-01-01&lt;BR /&gt;2023-03-18&lt;BR /&gt;2023-10-24&lt;BR /&gt;2023-10-23&lt;BR /&gt;];&lt;BR /&gt;//Inplace of inline load the excel of the holidays, &lt;BR /&gt;//data can be automated using the same prefix and suffix for files for each year&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//All dates autogenerated between the date that you want to find the network days&lt;BR /&gt;Dates:&lt;BR /&gt;Load&lt;BR /&gt;date($(vFirstDate)+rowno()-1) as Date&lt;BR /&gt;autogenerate($(vLastDate)-$(vFirstDate)+1);&lt;/P&gt;
&lt;P&gt;Working_Dates:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;weekDay(Date) AS Day,&lt;BR /&gt;if(match(num(weekday(Date)),0) // Sunday non-working //0 = default offset value for sunday in qliksense&lt;BR /&gt;or applymap('Holidays',Date,0)=1, // Filtering out holidays out of the total dates.&lt;BR /&gt;0, // Add zero as it is holiday&lt;BR /&gt;1) // Add one as it is working day&lt;BR /&gt;as working_nonWorking_tag&lt;BR /&gt;resident Dates;&lt;BR /&gt;drop table Dates;&lt;/P&gt;
&lt;P&gt;//Use sum (working_nonWorking_tag) to get the working days&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deepanshuSh_0-1696835496050.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117872iBF839CD3B505CC6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deepanshuSh_0-1696835496050.png" alt="deepanshuSh_0-1696835496050.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 07:11:46 GMT</pubDate>
    <dc:creator>deepanshuSh</dc:creator>
    <dc:date>2023-10-09T07:11:46Z</dc:date>
    <item>
      <title>How to Get NetworkDays excluding Sunday and holidays</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Get-NetworkDays-excluding-Sunday-and-holidays/m-p/2126470#M91673</link>
      <description>&lt;P&gt;Hi, Fellow Qlikkers&lt;/P&gt;
&lt;P&gt;Below is a modified script for getting the network days without saturday and non-working-days (holidays)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SET vFirstDate = date#('2023-01-01','YYYY-MM-DD');&lt;BR /&gt;SET vLastDate = date#('2024-01-01','YYYY-MM-DD');&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Holidays of the year List&lt;BR /&gt;Holidays:&lt;BR /&gt;mapping LOAD date#(Date,'YYYY-MM-DD') as Date,1 INLINE [&lt;BR /&gt;Date&lt;BR /&gt;2023-01-01&lt;BR /&gt;2023-03-18&lt;BR /&gt;2023-10-24&lt;BR /&gt;2023-10-23&lt;BR /&gt;];&lt;BR /&gt;//Inplace of inline load the excel of the holidays, &lt;BR /&gt;//data can be automated using the same prefix and suffix for files for each year&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//All dates autogenerated between the date that you want to find the network days&lt;BR /&gt;Dates:&lt;BR /&gt;Load&lt;BR /&gt;date($(vFirstDate)+rowno()-1) as Date&lt;BR /&gt;autogenerate($(vLastDate)-$(vFirstDate)+1);&lt;/P&gt;
&lt;P&gt;Working_Dates:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;weekDay(Date) AS Day,&lt;BR /&gt;if(match(num(weekday(Date)),0) // Sunday non-working //0 = default offset value for sunday in qliksense&lt;BR /&gt;or applymap('Holidays',Date,0)=1, // Filtering out holidays out of the total dates.&lt;BR /&gt;0, // Add zero as it is holiday&lt;BR /&gt;1) // Add one as it is working day&lt;BR /&gt;as working_nonWorking_tag&lt;BR /&gt;resident Dates;&lt;BR /&gt;drop table Dates;&lt;/P&gt;
&lt;P&gt;//Use sum (working_nonWorking_tag) to get the working days&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deepanshuSh_0-1696835496050.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117872iBF839CD3B505CC6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deepanshuSh_0-1696835496050.png" alt="deepanshuSh_0-1696835496050.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 07:11:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Get-NetworkDays-excluding-Sunday-and-holidays/m-p/2126470#M91673</guid>
      <dc:creator>deepanshuSh</dc:creator>
      <dc:date>2023-10-09T07:11:46Z</dc:date>
    </item>
  </channel>
</rss>

