<?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 Exclude days from calculation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Exclude-days-from-calculation/m-p/1562679#M41007</link>
    <description>&lt;P&gt;I want to pull the 'Dates Off' field into the formula below instead of manually entering them one by one.&lt;/P&gt;&lt;P&gt;NetWorkDays([StartDate], [EndDate]) as "ExcludeWeekendHoliday"&lt;/P&gt;&lt;P&gt;Here is my code, can you help?&lt;/P&gt;&lt;P&gt;[Exclude Days]:&lt;BR /&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;'Dates Off',&lt;BR /&gt;'1/1/2018',&lt;BR /&gt;'1/15/2018',&lt;BR /&gt;'2/19/2018',&lt;BR /&gt;'3/30/2018',&lt;BR /&gt;'4/27/2018',&lt;BR /&gt;'5/28/2018',&lt;BR /&gt;'6/29/2018',&lt;BR /&gt;'7/5/2018',&lt;BR /&gt;'7/4/2018',&lt;BR /&gt;'8/14/2018',&lt;BR /&gt;'9/3/2018',&lt;BR /&gt;'10/31/2018',&lt;BR /&gt;'11/22/2018',&lt;BR /&gt;'11/23/2018',&lt;BR /&gt;'12/24/2018',&lt;BR /&gt;'12/25/2018',&lt;/P&gt;&lt;P&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;tblCalculation:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;EndDate,&lt;/P&gt;&lt;P&gt;NetWorkDays([StartDate], [EndDate]) as "ExcludeWeekendHoliday"&lt;/P&gt;&lt;P&gt;Resident Supply ;&lt;/P&gt;&lt;P&gt;Drop Table Supply ;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2019 03:27:10 GMT</pubDate>
    <dc:creator>leobrand</dc:creator>
    <dc:date>2019-03-29T03:27:10Z</dc:date>
    <item>
      <title>Exclude days from calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Exclude-days-from-calculation/m-p/1562679#M41007</link>
      <description>&lt;P&gt;I want to pull the 'Dates Off' field into the formula below instead of manually entering them one by one.&lt;/P&gt;&lt;P&gt;NetWorkDays([StartDate], [EndDate]) as "ExcludeWeekendHoliday"&lt;/P&gt;&lt;P&gt;Here is my code, can you help?&lt;/P&gt;&lt;P&gt;[Exclude Days]:&lt;BR /&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;'Dates Off',&lt;BR /&gt;'1/1/2018',&lt;BR /&gt;'1/15/2018',&lt;BR /&gt;'2/19/2018',&lt;BR /&gt;'3/30/2018',&lt;BR /&gt;'4/27/2018',&lt;BR /&gt;'5/28/2018',&lt;BR /&gt;'6/29/2018',&lt;BR /&gt;'7/5/2018',&lt;BR /&gt;'7/4/2018',&lt;BR /&gt;'8/14/2018',&lt;BR /&gt;'9/3/2018',&lt;BR /&gt;'10/31/2018',&lt;BR /&gt;'11/22/2018',&lt;BR /&gt;'11/23/2018',&lt;BR /&gt;'12/24/2018',&lt;BR /&gt;'12/25/2018',&lt;/P&gt;&lt;P&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;tblCalculation:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;EndDate,&lt;/P&gt;&lt;P&gt;NetWorkDays([StartDate], [EndDate]) as "ExcludeWeekendHoliday"&lt;/P&gt;&lt;P&gt;Resident Supply ;&lt;/P&gt;&lt;P&gt;Drop Table Supply ;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 03:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclude-days-from-calculation/m-p/1562679#M41007</guid>
      <dc:creator>leobrand</dc:creator>
      <dc:date>2019-03-29T03:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude days from calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Exclude-days-from-calculation/m-p/1562684#M41008</link>
      <description>&lt;P&gt;Are you asking how to take the [Dates Off] into account in the NetWorkDays() calculation. Then do something like (assuming D/M/YYYY is your default date format):&lt;/P&gt;&lt;PRE&gt;[Exclude Days]:
LOAD Concat(Chr(39) &amp;amp; [Dates Off] &amp;amp; Chr(39), ',') as Holidays
;
LOAD * 
INLINE [
Dates Off,
1/1/2018,
1/15/2018
...
12/24/2018,
12/25/2018,
]
;

Let vHolidays = Peek('Holidays');
DROP Table [Exclude Days];

NetWorkDays(StartDate, EndDate, $(vHolidays)) as ...&lt;/PRE&gt;&lt;P&gt;vHolidays should contain a comma separated list of quotes dates.&amp;nbsp; NetWorkDays() will now consider the dates in vHolidays as non-working, in addition to the weekends.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 04:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclude-days-from-calculation/m-p/1562684#M41008</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-03-29T04:37:24Z</dc:date>
    </item>
  </channel>
</rss>

