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: 
Sokkorn
Master
Master

NetWorkDays include Satursday

Hi All,

Please take a look below function

networkdays( start:date, end_date {, holiday} )

Returns the number of working days (Monday-Friday) between and including start_date and end_date.

Actually the requirement is include Satursday as working day.

So how can I get number of working days (Monday-Satursday) using networkdays function?

Your suggestion is much appreciate.

Regards,

Sokkorn

4 Replies
Not applicable

Hi,

If your requirement needs to include all saturadys then you can go this way

1)Subtract the two dates...you will get number of days

2) Week(date1)-Week(date2) ...this will give you the week difference

Every week has one sunday

3) From no of days subtract the week you will get number days without sunday.

Thanks

Sokkorn
Master
Master
Author

Hi Yogesh,

Thanks for reply. This one is work find if we don't think about public holiday.

My requirement is count day exclude [Public Holiday] + [Sunday] from period.

Let see example:

IDStartDateEndDate
101-11-201115-11-2011

In this period have 2 sunday(on 6 and 13) and 1 public holiday (on 10). So working day should be 11.

Note: Public holiday is another one table seperate from above table.

Any idea besides this?

Regards,

Sokkorn

Not applicable

Sokkom,

Firstly refer to my above post wherein you can calculate number of days excluding sunday.

Now to exclude public holiday here is the logic:

(Number of days) - (networkdays(date1,date2)-networkdays(date1,date2,holiday_list))

description is as follows: 

networkdays(date1,date2) : this will return number of workdays

networkdays(date1,date2,holiday_list) : this will returns number of actual days

(Total_Number_of_days) - (workdays-actualdays) = days excluding sunday and public holidays

Sokkorn
Master
Master
Author

Hi Yogesh,

Manay thanks for your prompt response.

Regards,

Sokkorn