<?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: Counting working days between dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627746#M230626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Filip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may try script like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tbl1:&lt;/P&gt;&lt;P&gt;LOAD Autonumber(Num(OrderDate) &amp;amp; '|' &amp;amp; Num(ShipmentDate)) as IntervalID,*, ShipmentDate-OrderDate as initialDNr INLINE [&lt;/P&gt;&lt;P&gt;Order, OrderDate, ShipmentDate&lt;/P&gt;&lt;P&gt;A,2013-02-07,2013-02-12&lt;/P&gt;&lt;P&gt;B,2013-12-30,2014-01-03&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wd:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Date,Wd&lt;/P&gt;&lt;P&gt;2013-02-08,1&lt;/P&gt;&lt;P&gt;2013-02-09,0&lt;/P&gt;&lt;P&gt;2013-02-10,0&lt;/P&gt;&lt;P&gt;2013-02-11,1&lt;/P&gt;&lt;P&gt;2013-02-12,1&lt;/P&gt;&lt;P&gt;2013-12-31,0&lt;/P&gt;&lt;P&gt;2014-01-01,0&lt;/P&gt;&lt;P&gt;2014-01-02,1&lt;/P&gt;&lt;P&gt;2014-01-03,1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wd_tmp:&lt;/P&gt;&lt;P&gt;load Date as NonWorkDate Resident wd where Wd=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bridge:&lt;/P&gt;&lt;P&gt;IntervalMatch (NonWorkDate) Load distinct OrderDate, ShipmentDate resident tbl1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (wd_tmp)&lt;/P&gt;&lt;P&gt;Load NonWorkDate, Autonumber(Num(OrderDate) &amp;amp; '|' &amp;amp; Num(ShipmentDate)) as IntervalID&lt;/P&gt;&lt;P&gt;Resident bridge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (tbl1)&lt;/P&gt;&lt;P&gt;load IntervalID, count(NonWorkDate) as nwd_nbr Resident wd_tmp Group by IntervalID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;load Order, OrderDate, ShipmentDate, initialDNr-nwd_nbr as wd_nbr Resident tbl1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Tables&amp;nbsp; bridge,wd_tmp,tbl1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 May 2014 09:17:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-26T09:17:59Z</dc:date>
    <item>
      <title>Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627742#M230622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table A is my fact table with orders:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Order&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;OrderDate&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ShipmentDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2013-02-07&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2013-02-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2013-12-30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014-01-03&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table B is my date table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Date&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;WorkingDay&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-02-08&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-02-09&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-02-10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-02-11&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-02-12&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;.....&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;.....&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013-12-31&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2014-01-01&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2014-01-02&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2014-01-03&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to count the shipment working days. The correct number of working days should be 3 for order A... and 2 for order B as New years eve and New years day is not working days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I count this? I've tried the NewWorkDays() function, but it doesn't handle our holidays. I've also tried the IntervalMatch() function without proceeding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Filip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 08:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627742#M230622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-26T08:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627743#M230623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Networkdays() has a third parameter which accepts your list of holidays. Have you tried that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 08:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627743#M230623</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-26T08:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627744#M230624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may do IntervalMatch or your own intersection table using while clause in load script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 08:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627744#M230624</guid>
      <dc:creator />
      <dc:date>2014-05-26T08:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627745#M230625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, how do I do that?&lt;/P&gt;&lt;P&gt;The best of all would be if I could get the sum of working days as a new column in table A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 08:46:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627745#M230625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-26T08:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627746#M230626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Filip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may try script like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tbl1:&lt;/P&gt;&lt;P&gt;LOAD Autonumber(Num(OrderDate) &amp;amp; '|' &amp;amp; Num(ShipmentDate)) as IntervalID,*, ShipmentDate-OrderDate as initialDNr INLINE [&lt;/P&gt;&lt;P&gt;Order, OrderDate, ShipmentDate&lt;/P&gt;&lt;P&gt;A,2013-02-07,2013-02-12&lt;/P&gt;&lt;P&gt;B,2013-12-30,2014-01-03&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wd:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Date,Wd&lt;/P&gt;&lt;P&gt;2013-02-08,1&lt;/P&gt;&lt;P&gt;2013-02-09,0&lt;/P&gt;&lt;P&gt;2013-02-10,0&lt;/P&gt;&lt;P&gt;2013-02-11,1&lt;/P&gt;&lt;P&gt;2013-02-12,1&lt;/P&gt;&lt;P&gt;2013-12-31,0&lt;/P&gt;&lt;P&gt;2014-01-01,0&lt;/P&gt;&lt;P&gt;2014-01-02,1&lt;/P&gt;&lt;P&gt;2014-01-03,1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wd_tmp:&lt;/P&gt;&lt;P&gt;load Date as NonWorkDate Resident wd where Wd=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bridge:&lt;/P&gt;&lt;P&gt;IntervalMatch (NonWorkDate) Load distinct OrderDate, ShipmentDate resident tbl1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (wd_tmp)&lt;/P&gt;&lt;P&gt;Load NonWorkDate, Autonumber(Num(OrderDate) &amp;amp; '|' &amp;amp; Num(ShipmentDate)) as IntervalID&lt;/P&gt;&lt;P&gt;Resident bridge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join (tbl1)&lt;/P&gt;&lt;P&gt;load IntervalID, count(NonWorkDate) as nwd_nbr Resident wd_tmp Group by IntervalID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;load Order, OrderDate, ShipmentDate, initialDNr-nwd_nbr as wd_nbr Resident tbl1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Tables&amp;nbsp; bridge,wd_tmp,tbl1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 09:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627746#M230626</guid>
      <dc:creator />
      <dc:date>2014-05-26T09:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627747#M230627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Filip!&lt;/P&gt;&lt;P&gt;You can use this code:&lt;/P&gt;&lt;P&gt;Orders:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp; Order, OrderDate, ShipmentDate&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 2013-02-07, 2013-02-12&lt;/P&gt;&lt;P&gt;&amp;nbsp; B, 2013-12-30, 2014-01-03&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WorkDays:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date, WorkingDay&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-02-08, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-02-09, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-02-10, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-02-11, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-02-12, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2013-12-31, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2014-01-01, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2014-01-02, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2014-01-03, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;IntervalMatch(Date) LOAD OrderDate,ShipmentDate Resident Orders;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(temp)&lt;/P&gt;&lt;P&gt;LOAD * Resident Orders;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(temp)&lt;/P&gt;&lt;P&gt;LOAD * Resident WorkDays;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Tables Orders,WorkDays;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;orders_work_days:&lt;/P&gt;&lt;P&gt;LOAD Order, OrderDate, ShipmentDate, Sum(WorkingDay) as WorkongDays&lt;/P&gt;&lt;P&gt;Resident temp&lt;/P&gt;&lt;P&gt;Group By Order, OrderDate, ShipmentDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 10:09:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627747#M230627</guid>
      <dc:creator />
      <dc:date>2014-05-26T10:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627748#M230628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, this works great!&lt;/P&gt;&lt;P&gt;Can you please explain the stages with the bridge, that I didn't understand (though it worked)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 08:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627748#M230628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-27T08:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Counting working days between dates</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627749#M230629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your post, this works well if you only have order headers... My example was a bit simplified, when assigning this to my real data with order rows, I got duplicate values on each row using the sum() function. Dariusz example above works perfect with rows as well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 08:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-working-days-between-dates/m-p/627749#M230629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-27T08:21:47Z</dc:date>
    </item>
  </channel>
</rss>

