<?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: Networkdays function does not returning syntax error in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572427#M740681</link>
    <description>&lt;P&gt;You are mixing case (DATE is not the same field as date), and missing a group by on the load. I would do it like this:&lt;/P&gt;&lt;PRE&gt;temp:
load *,
	NetWorkDays(minDate, maxDate) as nwdays;
load
	key,
	min(date) as minDate,
	max(date) as maxDate,
resident table1
group by key;&lt;/PRE&gt;</description>
    <pubDate>Wed, 24 Apr 2019 05:38:53 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2019-04-24T05:38:53Z</dc:date>
    <item>
      <title>Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1571343#M740676</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In my data set i have only one date column . I am creating one composite key (concatenating&amp;nbsp; few columns ) as&lt;/P&gt;&lt;P&gt;distintct xx &amp;amp;'-'&amp;amp;&amp;nbsp; yy &amp;amp;'-'&amp;amp;&amp;nbsp; zz as key&lt;/P&gt;&lt;P&gt;in the fact table.&lt;/P&gt;&lt;P&gt;then creating one&amp;nbsp; table to calculate day difference&amp;nbsp;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;key,&lt;/P&gt;&lt;P&gt;min(date),&lt;/P&gt;&lt;P&gt;max(date),&lt;/P&gt;&lt;P&gt;NetWorkDays(DATE(MAX(DATE),'DD/MM/YYYY'),DATE(MIN(DATE),'DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;resident table1;&lt;/P&gt;&lt;P&gt;when loading this script , i am getting syntax error . I have tried this&amp;nbsp; NetWorkDays(max(date),min(date)) but same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the front end i have created a chart and used the above formula as expression , however it does not gives any error but is giving wrong number e.g max(date) =12-02-2019 and min (date) = 12-02-2019 , return same and networkdays return =1 .&lt;/P&gt;&lt;P&gt;Could you please help me where i am doing wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1571343#M740676</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1571400#M740677</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you have a missing bracket on your script:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NetWorkDays( DATE(MAX(DATE),'DD/MM/YYYY') , DATE(MIN(DATE),'DD/MM/YYYY') '==&amp;gt; you forgot this one )'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 13:14:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1571400#M740677</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2019-04-19T13:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572386#M740678</link>
      <description>Hi, I am sorry, I did not get you. I am using the following syntax NetWorkDays(DATE(MAX(DATE),'DD/MM/YYYY'),DATE(MIN(DATE),'DD/MM/YYYY')) as AGE syntax is fine , I am not getting any syntax error. Could you please tell me where you want me to put the ' '</description>
      <pubDate>Wed, 24 Apr 2019 03:52:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572386#M740678</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-04-24T03:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572402#M740679</link>
      <description>If you are using aggregation function in script then you need group by clause. Try below&lt;BR /&gt;&lt;BR /&gt;temp:&lt;BR /&gt;load key,&lt;BR /&gt;min(date),&lt;BR /&gt;max(date),&lt;BR /&gt;NetWorkDays(DATE(MAX(DATE),'DD/MM/YYYY'),DATE(MIN(DATE),'DD/MM/YYYY')) as Age&lt;BR /&gt;resident table1&lt;BR /&gt;Group by key&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Wed, 24 Apr 2019 04:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572402#M740679</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2019-04-24T04:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572426#M740680</link>
      <description>&lt;P&gt;Thank you Prashant, it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed the network days is not calculating the correct number of days, for example. it is calculating 1 day between&lt;/P&gt;&lt;P&gt;01/01/2019 and 01/01/2019 …. (dd/mm/yyyy)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 05:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572426#M740680</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-04-24T05:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572427#M740681</link>
      <description>&lt;P&gt;You are mixing case (DATE is not the same field as date), and missing a group by on the load. I would do it like this:&lt;/P&gt;&lt;PRE&gt;temp:
load *,
	NetWorkDays(minDate, maxDate) as nwdays;
load
	key,
	min(date) as minDate,
	max(date) as maxDate,
resident table1
group by key;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 05:38:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572427#M740681</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-04-24T05:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572430#M740682</link>
      <description>Yes it is working as expected. see in help menu.&lt;BR /&gt;You can also try Interval() to calculate days difference between start date and end date</description>
      <pubDate>Wed, 24 Apr 2019 05:47:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572430#M740682</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2019-04-24T05:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572442#M740683</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/170"&gt;@ashis&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;[…]&lt;SPAN&gt;I noticed the network days is not calculating the correct number of days, for example. it is calculating 1 day between&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;01/01/2019 and 01/01/2019 …. (dd/mm/yyyy)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is the correct calculation as you have not listed January 1 as a holiday.&lt;/P&gt;&lt;P&gt;T&lt;SPAN&gt;he n&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;etworkdays f&lt;/SPAN&gt;&lt;SPAN&gt;unction returns the number of working days (Monday-Friday) between and including&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;start_date&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;end_date&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;taking into account any optionally listed&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;holiday&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/networkdays.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/networkdays.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 06:10:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572442#M740683</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-24T06:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572451#M740684</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;as suggested , I am using the following syntax;&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;LOAD*,&lt;BR /&gt;NetWorkDays(STARTDATE,LASTDATE) AS AGE;&lt;BR /&gt;load&lt;BR /&gt;AdjustmentKey,&lt;BR /&gt;min(DATE) AS STARTDATE,&lt;BR /&gt;max(DATE) AS LASTDATE&lt;BR /&gt;Resident table&lt;BR /&gt;Group by Key;&lt;/P&gt;&lt;P&gt;However the AGE field that is getting calculated in the temp table is seems incorrect. Same day difference is counting 1 , where as if I calculate the this in front end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interval(DATE(LASTDATE,'DD/MM/YYYY') - DATE(STARTDATE,'DD/MM/YYYY'),'D')&lt;/P&gt;&lt;P&gt;it shows 0 for same day.&lt;/P&gt;&lt;P&gt;Is something I am doing wrong .&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 06:23:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572451#M740684</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-04-24T06:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572460#M740685</link>
      <description>&lt;P&gt;Hi Vegar,&lt;/P&gt;&lt;P&gt;Thank you for your input. It makes sense.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 06:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572460#M740685</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-04-24T06:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Networkdays function does not returning syntax error in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572470#M740686</link>
      <description>Regarding your interval question regarding Interval(Date(LASTDATE,'DD/MM/YYYY')&lt;BR /&gt;- Date(STARTDATE,'DD/MM/YYYY'),'D')&lt;BR /&gt;&lt;BR /&gt;Date(LASTDATE,'DD/MM/YYYY') and Date(LASTDATE,'DD/MM/YYYY') should be&lt;BR /&gt;thought on as a number.&lt;BR /&gt;If both LASTDATE and STARDATE are 24/04/2019 then each of your Date()&lt;BR /&gt;expression equals to 43579.&lt;BR /&gt;&lt;BR /&gt;Giving you the intervalexpression below:&lt;BR /&gt;&lt;BR /&gt;Interval(43579 - 43579 ,'D') = Interval(0 ,'D') = 0&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Apr 2019 07:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Networkdays-function-does-not-returning-syntax-error-in-load/m-p/1572470#M740686</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-24T07:07:35Z</dc:date>
    </item>
  </channel>
</rss>

