<?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 Create function to calculate Neto Work Days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156479#M32340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aldo,&lt;/P&gt;&lt;P&gt;I hadn't realized you could create custom functions in VB for the script. I'll have to think about what I can do with that.&lt;/P&gt;&lt;P&gt;However, wouldn't your problem be better resolved with a chart expression like the following after modifying a little the data model to make a table with all the possible dates between the ranges linking that table with the work day and holiday table?&lt;/P&gt;&lt;P&gt;count(distinct if(Date&amp;gt;=Date1 and Date&amp;lt;=Date2&lt;BR /&gt; and IsWorkDay&lt;BR /&gt; and IsHoliday&amp;lt;&amp;gt;0,Date))&lt;/P&gt;&lt;P&gt;I did the attached example on the chart side, but with a some more work you can do the same on the script side with intervalmatch, joins and/or mappings instead of using a custom function.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Oct 2010 19:46:38 GMT</pubDate>
    <dc:creator>pover</dc:creator>
    <dc:date>2010-10-23T19:46:38Z</dc:date>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156478#M32339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.02.89.41/Neto-Work-Time-between-Date1-and-Date2.qvw]&lt;/P&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;Please see the attachment below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;What I need to achieve, is to calculate the number of working days between &lt;B&gt;Date1&lt;/B&gt; and &lt;B&gt;Date2&lt;/B&gt;, as detailed below.&lt;/P&gt;&lt;P dir="ltr"&gt;Since I did not find a way to solve it throw tables, I am trying with VB Script.&lt;/P&gt;&lt;P dir="ltr"&gt;It is almost done, but having a problem with function NetoWork.&lt;/P&gt;&lt;P dir="ltr"&gt;Thanks in advance,&lt;/P&gt;&lt;P dir="ltr"&gt;Aldo.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;Date1&lt;/B&gt;= 07/10/2010 - Thursday - Working day&lt;/P&gt;&lt;P dir="ltr"&gt;08/10/2010 - Friday - NOT Working day&lt;/P&gt;&lt;P dir="ltr"&gt;09/10/2010 - Saturday- NOT Working day&lt;/P&gt;&lt;P dir="ltr"&gt;10/10/2010 - Sunday&lt;/P&gt;&lt;P dir="ltr"&gt;11/10/2010 - Monday - Holiday&lt;/P&gt;&lt;P dir="ltr"&gt;12/10/2010 - Tuesday&lt;/P&gt;&lt;P dir="ltr"&gt;13/10/2010 - Wednesday&lt;/P&gt;&lt;P dir="ltr"&gt;14/10/2010 - Thursday&lt;/P&gt;&lt;P dir="ltr"&gt;15/10/2010 - Friday- NOT Working day&lt;/P&gt;&lt;P dir="ltr"&gt;16/10/2010 - Saturday- NOT Working day&lt;/P&gt;&lt;P dir="ltr"&gt;17/10/2010 - Sunday&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;Date2&lt;/B&gt;= 18/10/2010 - Monday&lt;/P&gt;&lt;P dir="ltr"&gt;And if I defined 11/10/2010 as Holiday, then I should get:&lt;/P&gt;&lt;P dir="ltr"&gt;Neto Working Days = 6 Days.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Oct 2010 19:01:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156478#M32339</guid>
      <dc:creator />
      <dc:date>2010-10-23T19:01:54Z</dc:date>
    </item>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156479#M32340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aldo,&lt;/P&gt;&lt;P&gt;I hadn't realized you could create custom functions in VB for the script. I'll have to think about what I can do with that.&lt;/P&gt;&lt;P&gt;However, wouldn't your problem be better resolved with a chart expression like the following after modifying a little the data model to make a table with all the possible dates between the ranges linking that table with the work day and holiday table?&lt;/P&gt;&lt;P&gt;count(distinct if(Date&amp;gt;=Date1 and Date&amp;lt;=Date2&lt;BR /&gt; and IsWorkDay&lt;BR /&gt; and IsHoliday&amp;lt;&amp;gt;0,Date))&lt;/P&gt;&lt;P&gt;I did the attached example on the chart side, but with a some more work you can do the same on the script side with intervalmatch, joins and/or mappings instead of using a custom function.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Oct 2010 19:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156479#M32340</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-10-23T19:46:38Z</dc:date>
    </item>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156480#M32341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karl,&lt;/P&gt;&lt;P&gt;Something is wrong with the file. Could you upload it again, please?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Oct 2010 20:36:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156480#M32341</guid>
      <dc:creator />
      <dc:date>2010-10-23T20:36:07Z</dc:date>
    </item>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156481#M32342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it again. What error does it send you? Failed to Load?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Oct 2010 21:07:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156481#M32342</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-10-23T21:07:40Z</dc:date>
    </item>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156482#M32343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.02.89.41/NetoWork2.qvw]&lt;/P&gt;&lt;P&gt;I tried to work it around using interval match, but having problems to set the "Count" expression..&lt;/P&gt;&lt;P&gt;How do I solve it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Oct 2010 08:47:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156482#M32343</guid>
      <dc:creator />
      <dc:date>2010-10-24T08:47:39Z</dc:date>
    </item>
    <item>
      <title>Create function to calculate Neto Work Days</title>
      <link>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156483#M32344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.02.89.41/NetoWork3.qvw]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay! I have it working!!&lt;/P&gt;&lt;P&gt;Is there any simpler and faster way to do it?&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Oct 2010 09:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-function-to-calculate-Neto-Work-Days/m-p/156483#M32344</guid>
      <dc:creator />
      <dc:date>2010-10-24T09:11:14Z</dc:date>
    </item>
  </channel>
</rss>

