
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change Weekend in NetWorkDays Function
Hello everyone!
Is it possible to change the weekend of the function Networkdays by passing a parameter or something like that? Our weekend is Friday and Saturday, and the default of Qlik Sense is Saturday and Sunday. I tried changing FirstWeekDay to the following:
SET FirstWeekDay=6;
Also changed the Daynames but with no luck, Sunday gets excluded from the calculation.
I found a few solutions such as NetworkingDays(DateA+1, DateB+1) but it gives incorrect numbers.
Your help is appreciated!
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it does take both start and end date into account:
The networkdays function returns the number of working days (Monday-Friday) between and including start_date andend_date taking into account any optionally listed holiday.
Hence, to exclude start date, add another +1 to this date.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you post a sample where Networkdays(StartDate + 1, EndDate+1) returns incorrect numbers and what you expect to see instead?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Stefan!
Using the function with the following days:
26-7-2015 and 28-7-2015 returns 3 instead of 2. Unless it calculates the start date as well?
Thanks Stefan!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it does take both start and end date into account:
The networkdays function returns the number of working days (Monday-Friday) between and including start_date andend_date taking into account any optionally listed holiday.
Hence, to exclude start date, add another +1 to this date.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Stefan,
Is it possible to return the time in minutes not days?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A day has 24*60 minutes, so maybe just multiply by this number?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Stefan
My issue is what if the number returned is ZERO? as subtracting 1 will eliminate a full working day; in addition, even by not subtracting one, the result is kind of inaccurate as well (i.e. assuming an employee finishes a task within an hour, it will be calculated as a full working day and worse if the task goes to two different employees, Emp1 finished and then the task goes to Emp2 who also finished within the same day the function will calculate 2 working days instead of 1) That is why I was asking about actual minutes not converting days to minutes. By the way I am using the function at each step of an application history (Now I kind of think that it can not be used like this) and the reason is because I don't calculate steps where an application is returned to the applicant.
Wishing for your feedback!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's hard to answer without knowing the details of your data model.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please tell how to include Saturday in working days.
