<?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: Using a variable in NetWorkDays function? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270695#M623739</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;If you have the holiday dates in a field or you can create an excel with the holidays and then do this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_Holidays:&lt;/P&gt;&lt;P&gt;LOAD Holidays&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\Holidays.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you create a variable with all the dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_Concat:&lt;/P&gt;&lt;P&gt;LOAD concat(chr(39)&amp;amp; Holidays&amp;amp; chr(39),',') as All_Holidays&lt;/P&gt;&lt;P&gt;RESIDENT tmp_Holidays;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vHolidays = fieldvalue('All_Holidays'),1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dont forget to drop tmp tables&lt;/P&gt;&lt;P&gt;Drop tables tmp_Holidays,tmp_Concat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you use vHolidays with NetworkDays like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(Date_Begin,Date_End,$(vHolidays))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this Helps,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Dec 2016 22:38:35 GMT</pubDate>
    <dc:creator>joseduque</dc:creator>
    <dc:date>2016-12-15T22:38:35Z</dc:date>
    <item>
      <title>Using a variable in NetWorkDays function?</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270693#M623733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a .qvw file in which I'm using the NetWorkDays function quite often, with a long list of holiday dates, like this:&lt;/P&gt;&lt;P&gt;NetWorkDays(HRS_DT,DateEntered,'2016-1-1','2016-1-18','2016-2-15','2016-5-30','2016-7-4','2016-9-5','2016-11-24','2016-11-25','2016-12-26','2017-1-2','2017-1-16','2017-2-20')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I'm using the function so many times, I'd prefer to use a Variable in place of the long list of dates, so that when I have to add dates, I only have to do it in one place.&amp;nbsp; So far I've been unable to do this; it is possible, and if so, how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris Funkhouser&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 20:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270693#M623733</guid>
      <dc:creator>cfunkhouser</dc:creator>
      <dc:date>2016-12-15T20:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in NetWorkDays function?</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270694#M623736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vHols =&amp;nbsp; MID('2016-1-1'&amp;amp;'2016-1-18'&amp;amp;'2016-2-15'&amp;amp;'2016-5-30'&amp;amp;'2016-7-4'&amp;amp;'2016-9-5'&amp;amp;'2016-11-24'&amp;amp;'2016-11-25'&amp;amp;'2016-12-26'&amp;amp;'2017-1-2'&amp;amp;'2017-1-16'&amp;amp;'2017-2-20', 2) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;= NetWorkDays(HRS_DT,DateEntered,vHols)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 21:50:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270694#M623736</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-12-15T21:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in NetWorkDays function?</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270695#M623739</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;If you have the holiday dates in a field or you can create an excel with the holidays and then do this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_Holidays:&lt;/P&gt;&lt;P&gt;LOAD Holidays&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\Holidays.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you create a variable with all the dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp_Concat:&lt;/P&gt;&lt;P&gt;LOAD concat(chr(39)&amp;amp; Holidays&amp;amp; chr(39),',') as All_Holidays&lt;/P&gt;&lt;P&gt;RESIDENT tmp_Holidays;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vHolidays = fieldvalue('All_Holidays'),1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dont forget to drop tmp tables&lt;/P&gt;&lt;P&gt;Drop tables tmp_Holidays,tmp_Concat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you use vHolidays with NetworkDays like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NetWorkDays(Date_Begin,Date_End,$(vHolidays))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this Helps,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 22:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270695#M623739</guid>
      <dc:creator>joseduque</dc:creator>
      <dc:date>2016-12-15T22:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable in NetWorkDays function?</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270696#M623741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Jose!&amp;nbsp; That worked like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 03:34:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-in-NetWorkDays-function/m-p/1270696#M623741</guid>
      <dc:creator>cfunkhouser</dc:creator>
      <dc:date>2016-12-16T03:34:57Z</dc:date>
    </item>
  </channel>
</rss>

