Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Network Days problem

Hi all,

I'm trying to calculate Network Days from one date to another, excluding Public Holidays.

In my example, I have a Start date of : 14/04/2015 and End Date :12/06/2015, with a Public Holiday of 08/06/2015

Using the expression : NetWorkDays(Appr,Auth,PublicHol) I get days of : 43, but when I calculate it manually I get 42, which is the correct answer. My client expects 42 and I calculate 42, not 43.

What am I doing wrong? - I've attached the sample .qvw - perhaps I'm missing something?

Many thanks!

4 Replies
rubenmarin

Hi coco, I count:

13 for apr

21 for may

9 for jun

Total: 43

Gysbert_Wassenaar

You or your calculator is wrong. Perhaps you're simply subtracting two dates and then subtracting the weekend days and the holiday. If that's the case you're not counting the last date as a day. The difference between two consecutive days is one, but they are still two days.


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

As Gysbert already pointed out and as the HELP states:

The networkdays function returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holiday.


But I assume that's not your issue, otherwise you would have noticed the same issue with Ref B, right?

So, could you please clarify how you calculate what you defined as 'correct' value in more detailed steps?

On a side note, your current approach of defining public holidays per Ref will only work for a single public holiday per Ref, not for a list of holidays. Could this trigger (other) issues as well?

jagan
Luminary Alumni
Luminary Alumni