Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

number of weekday count

I have a very simple question, how to calculate the number of weekdays between 2 date fields?

4 Replies
johnw
Champion III
Champion III

networkdays ( start_date, end_date {, holiday} )

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

Examples:

networkdays ('2007-02-19', '2007-03-01')   returns 9

networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26')   returns 8

Not applicable
Author

Hi, the networkdays function is indeed correct. But do you know maybe how I should use it in case when I am counting days between two dates which in different cases can be: Date1 < Date2 or Date1>Date2.

Then the networkdays (Date1, Date2) is working only in case Date1 is earlier than Date2...

Do you have any tip?

Thanks in advance.

johnw
Champion III
Champion III

if(Date1<Date2,networkdays(Date1,Date2),networkdays(Date2,Date1))

mvaugusto
Creator
Creator

It worked for me, thanks