<?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: Obtain effective working days using NetWorkDays() in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163340#M94451</link>
    <description>&lt;P&gt;Seems you forgot to give field name for networkdays calculation&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;NetWorkDays(Min(Date), Max(Date)) as workdays,&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2024 15:03:22 GMT</pubDate>
    <dc:creator>anat</dc:creator>
    <dc:date>2024-01-19T15:03:22Z</dc:date>
    <item>
      <title>Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163338#M94449</link>
      <description>&lt;P&gt;I am trying to obtain the average of products made within the working days of the period from when I have available data until now, which means for each week, counting the total pieces made and divided by the number of days effectively worked, what was the average produced?&lt;/P&gt;
&lt;P&gt;The problem is when I try to obtain the working days measure, as I get it like this currently within my Master Calendar:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MasterCalendar:
LOAD
    Date,
    Year(Date) as Year,
    'Q' &amp;amp; Ceil(Month(Date)/3) as Quarter,
    Month(Date) as Month,
    Week(Date,1,1) as Week,
    Day(Date) as Day,
    NetWorkDays(Min(Date), Max(Date), v$(Holidays)),
    WeekDay(Date) as Weekday,
    MonthName(Date) as MonthYear,
    Year(Date) &amp;amp; '-' &amp;amp; Week(Date,1,1) as WeekYear,
    Year(Date) &amp;amp; '-Q' &amp;amp; Ceil(Month(Date)/3) as QuarterYear 	
   
Resident ActivityLog;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, I have a list of holidays that will be omitted. But even if I don't input anything there, I still get an error:&lt;/P&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;The following error occurred:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Invalid expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;The error occurred here:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;MasterCalendar:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;LOAD&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Date,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Year(Date) as Year,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;'Q' &amp;amp; Ceil(Month(Date)/3) as Quarter,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Month(Date) as Month,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Week(Date,1,1) as Week,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Day(Date) as Day,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;NetWorkDays(Min(Date), Max(Date)),&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;WeekDay(Date) as Weekday,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;MonthName(Date) as MonthYear,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Year(Date) &amp;amp; '-' &amp;amp; Week(Date,1,1) as WeekYear,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Year(Date) &amp;amp; '-Q' &amp;amp; Ceil(Month(Date)/3) as QuarterYear&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Resident ActivityLog&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message empty"&gt;
&lt;DIV class="selectable"&gt;---&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;The following error occurred:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="message error"&gt;
&lt;DIV class="selectable"&gt;Invalid expression&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Jan 2024 14:57:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163338#M94449</guid>
      <dc:creator>alespooletto</dc:creator>
      <dc:date>2024-01-19T14:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163340#M94451</link>
      <description>&lt;P&gt;Seems you forgot to give field name for networkdays calculation&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;NetWorkDays(Min(Date), Max(Date)) as workdays,&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163340#M94451</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T15:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163343#M94452</link>
      <description>&lt;P&gt;NetWorkDays(Min(Date), Max(Date), v$(Holidays)) as fieldname,&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:06:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163343#M94452</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T15:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163358#M94454</link>
      <description>&lt;P&gt;Thank you, but it seems like it's still not working even with the fieldname. Is there anything else you think might be useful?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163358#M94454</guid>
      <dc:creator>alespooletto</dc:creator>
      <dc:date>2024-01-19T15:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163364#M94456</link>
      <description>&lt;P&gt;if possible can you share error message and script what ur using...&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163364#M94456</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163367#M94457</link>
      <description>&lt;P&gt;NetWorkDays(Min(Date), Max(Date), &lt;STRONG&gt;v&lt;/STRONG&gt;$(Holidays))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why v before $ in expression?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:04:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163367#M94457</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T16:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163373#M94458</link>
      <description>&lt;P&gt;Yeah, my bad there it should be vHolidays, another variable that I created earlier. But as I mentioned, unfortunately this still doesn't work even without the Holidays.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the error, all I get is 'Invalid Expression'. You may find a screenshot attached here&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alespooletto_0-1705680857720.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127422i63F9908451405BAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alespooletto_0-1705680857720.png" alt="alespooletto_0-1705680857720.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:14:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163373#M94458</guid>
      <dc:creator>alespooletto</dc:creator>
      <dc:date>2024-01-19T16:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163378#M94459</link>
      <description>&lt;P&gt;can you go through below script and check your script.&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;PayTable:&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;LOAD recno() as InvID, * INLINE [&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;InvRec|InvPaid&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;28/03/2012|28/04/2012&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;10/12/2012|01/01/2013&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;5/2/2013|5/3/2013&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;31/3/2013|01/5/2013&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;19/5/2013|12/6/2013&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;15/9/2013|6/10/2013&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;11/12/2013|12/01/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;2/3/2014|2/4/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;14/5/2014|14/6/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;13/6/2014|14/7/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;7/7/2014|14/8/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;4/8/2014|4/9/2014&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;] (delimiter is '|');&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;NrDays:&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;Load *,&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;NetWorkDays(InvRec,InvPaid) As PaidDays&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;Resident PayTable;&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;Drop table PayTable;&lt;/P&gt;
&lt;P class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:27:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163378#M94459</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T16:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163386#M94462</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/253882"&gt;@alespooletto&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found a logic problem in your script.&lt;/P&gt;
&lt;P&gt;You are using the same value for the star and the end date, so the difference will always be 1 day.&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47358"&gt;@anat&lt;/a&gt;&amp;nbsp;suggests, you should use two different values, without the Min and Max functions.&lt;/P&gt;
&lt;P&gt;The original formula:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NetWorkDays(Min(Date), Max(Date), v$(Holidays)) as fieldname&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should become:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NetWorkDays(Start_Date, End_Date, v$(Holidays)) as fieldname&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163386#M94462</guid>
      <dc:creator>Fabiano_Martino_Intelco</dc:creator>
      <dc:date>2024-01-19T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163387#M94463</link>
      <description>&lt;P&gt;you may try by creating 2 variables for min and max dates then use those dates in your networkdays logic.&lt;/P&gt;
&lt;P&gt;PayTable:&lt;/P&gt;
&lt;P&gt;LOAD recno() as InvID, * INLINE [&lt;/P&gt;
&lt;P&gt;InvRec,InvPaid&lt;/P&gt;
&lt;P&gt;28/03/2012,1&lt;/P&gt;
&lt;P&gt;10/12/2012,2&lt;/P&gt;
&lt;P&gt;5/2/2013,3&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;] (delimiter is ',');&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;min_max:&lt;BR /&gt;load min(InvRec) as min,max(InvRec) as max Resident PayTable;&lt;BR /&gt;vmin=Peek('min',-1,'min_max');&lt;BR /&gt;vmax=Peek('max',-1,'min_max');&lt;BR /&gt;drop Table min_max;&lt;/P&gt;
&lt;P&gt;NrDays:&lt;/P&gt;
&lt;P&gt;Load *,&lt;/P&gt;
&lt;P&gt;NetWorkDays($(vmin),$(vmax)) As PaidDays // recomended&lt;BR /&gt;//NetWorkDays(min(InvRec),max(InvRec)) As PaidDays //getting error&lt;BR /&gt;Resident PayTable;&lt;/P&gt;
&lt;P&gt;Drop table PayTable;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163387#M94463</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-01-19T16:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain effective working days using NetWorkDays()</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163531#M94474</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/253882"&gt;@alespooletto&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The error that you are getting in the script is because you are using aggr() functions without &lt;STRONG&gt;group by clause&lt;/STRONG&gt; while using your NetworkDays() function.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rohan.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 06:26:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-effective-working-days-using-NetWorkDays/m-p/2163531#M94474</guid>
      <dc:creator>Rohan</dc:creator>
      <dc:date>2024-01-20T06:26:25Z</dc:date>
    </item>
  </channel>
</rss>

