<?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 Negative values in networkdays in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860637#M1017262</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;&lt;/P&gt;&lt;P&gt;I am using the networkdays formula to calculate the number of networkdays between two dates as 'difference'. i want&amp;nbsp; difference-1, so am using formula like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;networkDays(billed_date,shipping_date)-1&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;The numbers are showing correctly as long as the difference is a positive number, but when it is a negative number all I get is -1, irrespective of the actual difference.&lt;/P&gt;&lt;P&gt;please.... help to get the correct&amp;nbsp; negative numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Apr 2015 14:16:09 GMT</pubDate>
    <dc:creator>slsaagar</dc:creator>
    <dc:date>2015-04-06T14:16:09Z</dc:date>
    <item>
      <title>Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860637#M1017262</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;&lt;/P&gt;&lt;P&gt;I am using the networkdays formula to calculate the number of networkdays between two dates as 'difference'. i want&amp;nbsp; difference-1, so am using formula like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;networkDays(billed_date,shipping_date)-1&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;The numbers are showing correctly as long as the difference is a positive number, but when it is a negative number all I get is -1, irrespective of the actual difference.&lt;/P&gt;&lt;P&gt;please.... help to get the correct&amp;nbsp; negative numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 14:16:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860637#M1017262</guid>
      <dc:creator>slsaagar</dc:creator>
      <dc:date>2015-04-06T14:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860638#M1017263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per my knowledge , Networking days function always give the positive result and if it has any negative values then it will show as 0 and since your using -1 it will show as -1, try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;billed_date&amp;gt;shipping_date,networkingdays(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;shipping_date,&lt;/STRONG&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;billed_date&lt;/STRONG&gt;),'-&amp;amp;(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;networkingdays(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;billed_date,&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;shipping_date&lt;/STRONG&gt;&lt;/STRONG&gt;)-1))&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 14:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860638#M1017263</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-04-06T14:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860639#M1017264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is how the function works. &lt;/P&gt;&lt;P&gt;For example the following returns 0 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;networkdays ('2007-02-19', '2007-01-01')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try an If statement : if function returns zero then calculate the same but with the dates in different order :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;networkdays ('2007-02-19', '2007-01-01') = 0, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;networkdays ('2007-01-01', '2007-02-19') * -1, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;networkdays ('2007-02-19', '2007-01-01'))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 14:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860639#M1017264</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2015-04-06T14:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860640#M1017265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first parameter to NetworkDays() is the start date and the second parameter is the end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the the end date supplied is before the start date, then this is by definition invalid as something cannot end before it starts and a value of zero is returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So try using something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM style=": ; color: #993300;"&gt;&lt;STRONG&gt;= if ( billed_date&amp;gt; shipping_date,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="color: #993300;"&gt;&lt;EM&gt;( NetWorkDays ( shipping_date, billed_date) * -1 ) + 1 ,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style=": ; color: #993300;"&gt;&lt;STRONG&gt;NetWorkDays ( billed_date, shipping_date)&amp;nbsp; -1&amp;nbsp; )&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 15:05:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860640#M1017265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-06T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860641#M1017266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank u all for ur replies this formula worked for my creteria...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(billeddate&amp;lt;=shippingdate,&lt;/P&gt;&lt;P&gt;NetWorkDays(billeddate,shippingdate)-1,(NetWorkDays(shippingdate,billeddate)*-1)-1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 08:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860641#M1017266</guid>
      <dc:creator>slsaagar</dc:creator>
      <dc:date>2015-05-11T08:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in networkdays</title>
      <link>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860642#M1017267</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;P&gt;sagar sl wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;thank u all for ur replies this formula worked for my creteria...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if(billeddate&amp;lt;=shippingdate,&lt;/P&gt;
&lt;P&gt;NetWorkDays(billeddate,shippingdate)-1,(NetWorkDays(shippingdate,billeddate)*-1)-1)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Well, this is still wrong.&lt;BR /&gt;Let's say billeddate = 3/4/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shippingdate = 4/4/2016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, expression would be&lt;/P&gt;&lt;P&gt;=if(date(3/4/2016)&amp;lt;=date(4/4/2016),&lt;/P&gt;&lt;P&gt;NetWorkDays(date(3/4/2016),date(4/4/2016))-1,(NetWorkDays(date(4/4/2016),date(3/4/2016))*-1)-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the result would still be -1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It can be simply done like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(NetWorkDays(&lt;SPAN style="font-size: 13.3333px;"&gt;billeddate &lt;/SPAN&gt;,&lt;SPAN style="font-size: 13.3333px;"&gt;shippingdate &lt;/SPAN&gt;)=0,NetWorkDays(&lt;SPAN style="font-size: 13.3333px;"&gt;billeddate &lt;/SPAN&gt;,&lt;SPAN style="font-size: 13.3333px;"&gt;shippingdate &lt;/SPAN&gt;),NetWorkDays(&lt;SPAN style="font-size: 13.3333px;"&gt;billeddate &lt;/SPAN&gt;,&lt;SPAN style="font-size: 13.3333px;"&gt;shippingdate &lt;/SPAN&gt;)-1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Assumption : shippingdate &amp;gt;= billeddate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that's not the case,&lt;BR /&gt;It should be&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(NetWorkDays(billeddate ,shippingdate )=0,If(NetWorkDays(shippingdate ,billeddate )=0,0,NetWorkDays(shippingdate ,billeddate )-1),NetWorkDays(billeddate ,shippingdate )-1)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 10:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Negative-values-in-networkdays/m-p/860642#M1017267</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-30T10:34:23Z</dc:date>
    </item>
  </channel>
</rss>

