Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation error with Networkdays() function

Hello,

I have a problem with the networkdays () function.

This function takes into account holidays that are not within the calculation interval:

for example:

My date format is as follows:

SET DateFormat = 'DD-MM-YY';

The call of the function:

Networkdays ('16 -01-17 ', '19 -01-17') referrals 4, between 16 and 19 January there are 4 working days: the result is correct.

If now I set the {holiday} parameter by simulating a holiday on 20/01/2017 (so after the 19th)

Networkdays ('16 -01-17 ', '19 -01-17', '20 -01-17 ',' 20-01-17 ') references 3.

I have this problem every time my end date and the day before a holiday.

Have you ever encountered this problem and what solution have you applied?

Thank you for your help

10 Replies
ajayvermaida
Partner - Creator
Partner - Creator

Hi Sunny,

can you please help me to calculating the time diff between two dates based on given points

1- First I have to calculate the time weekdays in between 7 Am to 11 PM excluding sat and sun . am using below script for this but prob is that when both the dates are weekend then its also calculate the time diff  .

if(not WildMatch(IssueStatus,'Pending') , (Interval((RangeMin(frac(IssueResolutionDate), MakeTime(23))- RangeMax(frac(IssueCreateDate), MakeTime(7)))+
( NetWorkDays(IssueCreateDate, IssueResolutionDate-1) * MakeTime(16)) ))) as TotalTime,

2- Second I have to calculate the time diff only Weekend Sat or Sun in between 10 Am to 4 PM . also if any dates is weekend and other one is weekday then it calculate the time based on diff time difference .

3- if any ticket open in the last month and closed in next month then it calculate the time as point 1 except if it comes on weekdays .

Please help me to find the correct result 

 

Thanks

Ajay