<?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: Calculating Time Period excluding holidays in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741605#M662494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The networkdate-function works fine (thanks for the tip with the "alt"-function), but a supplier can deliver his goods also on a Saturday. The networkdate excludes the Saturday. Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2015 19:36:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-04T19:36:27Z</dc:date>
    <item>
      <title>Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741601#M662490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple table that shows the variance between the Desired date to the Goods receipt date. That table is used to measure the performance of a supplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to show the fact that some holidays are not included in the calculation of the variance. I know how to set up the holidays in the script, but I don't know how to use it in the formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula for the Variance is very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(AVG((DATE(if(isNull(E_BelegPos.Liefertermin),E_BelegPos.Wunschtermin,E_BelegPos.Liefertermin)))-(E_BelegPos.WEDatum)))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;COUNT(E_BelegPos.ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Wunschtermin" is the desired date, "WEDatum" the Goods receipt date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best example is the first document 251791, here I want to exclude the Christmas Holidays (24.12.,25.12,26.12) and New Year, in total 5 days to exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 10:31:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741601#M662490</guid>
      <dc:creator />
      <dc:date>2015-02-04T10:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741602#M662491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hannes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the networkdays() function. You can pass your starting date, ending days and a list holiday dates to exclude into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function only counts the number of working days (Mon-Fri), you should be able to use this function twice, once with the holidays, second time without and take the resulting difference as the number of days you need to exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;Maybe have a look at this thread, might help&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/thread/142554"&gt;http://community.qlik.com/thread/142554&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 10:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741602#M662491</guid>
      <dc:creator />
      <dc:date>2015-02-04T10:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741603#M662492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the quick reply. I will try and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hannes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 11:01:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741603#M662492</guid>
      <dc:creator />
      <dc:date>2015-02-04T11:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741604#M662493</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;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Load script:&lt;/P&gt;&lt;P&gt;Set vHolidays = '2014/12/24', '2014/12/25', '2014/12/26';&amp;nbsp; // variable contains holiday dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In expression:&lt;/P&gt;&lt;P&gt;=Avg(NetWorkDays(Alt(E_BelegPos.Liefertermin, E_BelegPos.Liefertermin, E_BelegPos.WEDatum, $(vHolidays))))&lt;/P&gt;&lt;P&gt;/ COUNT(E_BelegPos.ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the SET statement must have quote delimited, comma separate list of dates in the correct date format for your system. You can construct the vHolidays array by using a spreadsheet containing holidays or linking to www.timeanddate.com. I use a variable rather than hard coding the holidays into the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alt() function returns the first parameter that is not null and a valid number. Dates are numbers. More compact and possibly more efficient than the if(IsNull()...) method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 11:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741604#M662493</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-02-04T11:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741605#M662494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The networkdate-function works fine (thanks for the tip with the "alt"-function), but a supplier can deliver his goods also on a Saturday. The networkdate excludes the Saturday. Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741605#M662494</guid>
      <dc:creator />
      <dc:date>2015-02-04T19:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741606#M662495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That depends on whether you want to exclude or include the Saturday in the metric. Its going to be awkward to include Saturdays if the delivery is on Saturday and exclude them otherwise. You might want to calculate workdays between &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;E_BelegPos.Liefertermin and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;E_BelegPos.WEDatum during loading (at an order line level), and then average this calculated amount for the metric.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 05:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741606#M662495</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-02-05T05:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741607#M662496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan, as I spoke with our Customer and he told me that a Supplier doesn't deliver on Saturday and Sundays, the networkdate is my 100% choice. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 09:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741607#M662496</guid>
      <dc:creator />
      <dc:date>2015-02-06T09:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Time Period excluding holidays</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741608#M662497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to come up again with this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula for my delivery in time-KPI is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(date(date#(E_BelegPos.Wunschtermin,'DD/MM/YY'))- date(date#(E_BelegPos.CALC_Liefertreue_Termin,'DD/MM/YY')) &amp;lt;= 5 and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(date#(E_BelegPos.Wunschtermin,'DD/MM/YY'))- date(date#(E_BelegPos.CALC_Liefertreue_Termin,'DD/MM/YY')) &amp;gt;= -1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Wunschtermin" is the date that I wish the goods to be accepted by the supplier.&lt;/P&gt;&lt;P&gt;The "&lt;SPAN style="font-size: 13.3333330154419px;"&gt;CALC_Liefertreue_Termin&lt;/SPAN&gt;" is the real goods receipt date,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We set all goods that come in 5 days before the "Wunschtermin" and one day after the "Wunschtermin" as IN TIME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have the challenge hat I would like to exlude the Saturday and the Sunday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The NetWorkDays-Function dosen't work for the early deliveries. I also tried to flag the Saturday and the Sunday, but this also doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 10:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Time-Period-excluding-holidays/m-p/741608#M662497</guid>
      <dc:creator />
      <dc:date>2015-02-17T10:20:28Z</dc:date>
    </item>
  </channel>
</rss>

