Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP
MVP

Re: number of weekday count

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

Re: number of weekday count

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.

MVP
MVP

Re: number of weekday count

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

mvaugusto
Contributor

Re: number of weekday count

It worked for me, thanks