Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Working hours

How do I calculate the Interval between two dates, and ignore AFTER working hours. In other words, only consider hours between 08:00 and 17:00.

10 Replies
rubenmarin

Ok Bradley, there it is:

=If(Floor(END)=Floor(START), Interval(END-START), //For task finished in the same day

// If not finished in the same day

    Interval(17/24 - Time('$(=Time(START))') // Hours to finish the first day

        + Time('$(=Time(END))') - 8/24 // Hours from start of end day to due time

        + ((Floor(END)- Floor(START)-1)*9/24) //Complete days between

    )

   )   

Hope his works, I didn't tested well.