Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Working days and hours calculations for custom weekends

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Kushal_Chawda

Working days and hours calculations for custom weekends

Last Update:

Sep 26, 2024 10:46:39 AM

Updated By:

Kushal_Chawda

Created date:

Jul 4, 2020 8:27:08 PM

Attachments

Previously, I created a document for calculating working hours between two dates, excluding weekends (Saturday and Sunday) and holidays, using the networkdays function. Please refer to the link below.

Working-Hours-Calculation-excluding-weekends-and-holidays

However, what if the weekends are not Saturday and Sunday (e.g., Thursday and Friday)? Or if only Sunday is considered a weekend, not Saturday? In such cases, the networkdays function won't be applicable. While there are many ways to address this, I will demonstrate one approach in this post.

I have detailed all scenarios step by step in the attached Word document and included example QVF files. This code is compatible with QlikView as well.

The logic described here can be applied to any defined weekends, but for regular weekends (Saturday and Sunday), I recommend using the built-in networkdays function for working day calculations. For working hour calculations, please refer to my previous document linked below.

Please feel free to share any suggestions.

Labels (2)
Comments
lindo
Contributor II
Contributor II

Hi there, can you please help me with this, it shows nothing

 

TicketNo,StartTime, EndTime
1, 8/16/2010 7:00:00 , 8/16/2010 14:00:00
2, 8/16/2010 10:00:00 , 8/16/2010 13:30:00

Contributors
Version history
Last update:
‎2024-09-26 10:46 AM
Updated by: