<?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: Calculation of networkdays in Qlik Learning Discussions</title>
    <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784548#M2149</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;Have tried this format to calculate networkdays() but it doesnt seem to be working . Is there any incorrect in my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(date(alt([Resolved Date],Date#([Resolved Date],'M/D/YYYY'),'M/D/YYYY'))&amp;gt;'', NetWorkDays(date(alt([Resolved Date],Date#([Resolved Date],'M/D/YYYY'),'M/D/YYYY')),date(alt([Date Raised],Date#([Date Raised],'M/D/YYYY'),'M/D/YYYY'))), &lt;BR /&gt;NetWorkDays(today(),date(alt([Date Raised],Date#([Date Raised],'M/D/YYYY'),'M/D/YYYY')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Dec 2014 06:07:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-12-26T06:07:45Z</dc:date>
    <item>
      <title>Calculation of networkdays</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784546#M2147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;@&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody please help urgently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need a simple solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calcuate the elapsed days i.e. networkdays between date raised and resolved date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply using networkdays() doesnt give the right answer since some of the rows in raised and resolved date columns are right, center or even left aligned.&lt;/P&gt;&lt;P&gt;have tried the below query but doesnt seem to work for all the rows.&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;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Resolved Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'M/D/YYYY') &amp;gt; '', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NetWorkDays&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date Raised]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'M/D/YYYY'),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Resolved Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'M/D/YYYY')),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NetWorkDays&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Date Raised]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'M/D/YYYY'), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),'M/D/YYYY') )) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Elapsed_Days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 08:44:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784546#M2147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-24T08:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of networkdays</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784547#M2148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;since some of the rows in raised and resolved date columns are right, center or even left aligned.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That means some of your dates are not dates, but text strings. You have to convert these in the script in real dates. You can use the alt function to capture the dates than aren't numeric dates already and convert them into dates using the date# function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;date(alt(MyDate,date#(MyDate,'M/D/YYYY'),'M/D/YYYY') as MyDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;...other fields....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;FROM &lt;EM&gt;...somewhere...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;See this blog post for more information:&amp;nbsp; &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/06/07/get-the-dates-right" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;Get the Dates Right&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 08:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784547#M2148</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-12-24T08:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of networkdays</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784548#M2149</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;Have tried this format to calculate networkdays() but it doesnt seem to be working . Is there any incorrect in my query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(date(alt([Resolved Date],Date#([Resolved Date],'M/D/YYYY'),'M/D/YYYY'))&amp;gt;'', NetWorkDays(date(alt([Resolved Date],Date#([Resolved Date],'M/D/YYYY'),'M/D/YYYY')),date(alt([Date Raised],Date#([Date Raised],'M/D/YYYY'),'M/D/YYYY'))), &lt;BR /&gt;NetWorkDays(today(),date(alt([Date Raised],Date#([Date Raised],'M/D/YYYY'),'M/D/YYYY')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Dec 2014 06:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784548#M2149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-26T06:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of networkdays</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784549#M2150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was a problem with the source data.I had to correct the way it was being exported. The query works fine now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 10:09:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Calculation-of-networkdays/m-p/784549#M2150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T10:09:45Z</dc:date>
    </item>
  </channel>
</rss>

