Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

NetWorkDays function

Hi,

I'm facing an issue with NetWorkDays function.

When I'm using this expression:  =NetWorkDays('11/12/2012','04/03/2013')

the result is 60, which is correct.

But when I'm using: =NetWorkDays('04/03/2013','11/12/2012')

The fuction returns 0, and I need it to return (-60).

How can I get (-60) instead of 0?

Thanks,

Aviad

3 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi try this

NetWorkDays(floor(('04/03/2013','11/12/2012'))

or

='-' & NetWorkDays(floor(('04/03/2013','11/12/2012')

Not applicable
Author

Hi,

Networkdays function would not return negative result,but 0.

In such a case,

Consider the below example,where I have a startdate and enddate

Data:

LOAD * INLINE
[
EmplNo,Amount,StartDate,EndDate
001,129.000,11/12/2012,12/15/2012
002,130.000,12/12/2012,12/15/2012
003,154.000,01/01/2013,05/01/2013
004,186.000,12/01/2013,12/01/2013
005,169.000,01/25/2013,01/27/2013
];

EmplNoAmtStartDate - EndDateEndDate-StartDate
--
00112925-25
0021303-3
00315487-87
00418600
0051691-1

For achieving (StartDate - EndDate) column result use the expression :

 

=NetWorkDays

(StartDate,EndDate)

For achieving (EndDate-StartDate) column result use the expression :

  

=NetWorkDays(StartDate,EndDate) * -1

Hence, you get the desired result.

Regards,
Snehal Nabar

Not applicable
Author

Hi aviad_we,

Please mark this post as answered,if your query is solved.

Regards,

Snehal Nabar