Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate hrs in a workday from start and end times

Hi All,

I have a begin time (8:00 AM) and end time (5:00 PM) with a lunch from 12:00 PM to 1:00 PM.  What do I need to do to get the number of hours worked that day expressed as an integer?

1700 - 0800 = 9 - (1300-1200) = 8 hours worked

thanks for the help!

1 Solution

Accepted Solutions
jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi John,

hoping this logic might be useful to you:

=24 *

(

(num(Time('17:00:00','h:mm:ss')) - num(Time('08:00:00','h:mm:ss')))

-

(num(Time('13:00:00','h:mm:ss')) - num(Time('12:00:00','h:mm:ss')))

)

Regards, JP

View solution in original post

1 Reply
jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi John,

hoping this logic might be useful to you:

=24 *

(

(num(Time('17:00:00','h:mm:ss')) - num(Time('08:00:00','h:mm:ss')))

-

(num(Time('13:00:00','h:mm:ss')) - num(Time('12:00:00','h:mm:ss')))

)

Regards, JP