Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jacekselega
New Contributor

Counting hours between working hours and days

Dears,

I have two timestamps and i would like to measure exact number of hours between those two dates.

The case is i would like to exclude all holidays in our comapny and to make this more complicated i need to take into account also working hours in company.  Any ideas ?

Thanks in advance for your help

/jacek

Tags (3)
3 Replies
Employee
Employee

Re: Counting hours between working hours and days

How many working hours a day do you have? Supposing you have 8 this expression can help you with some adjustments

=Interval(

  if(WeekDay(vStartDate)<=5, DayEnd(vStartDate) +'08:00:00' - vStartDate, 0) +

  if(WeekDay(vEndDate) <=5 , vEndDate - DayStart(vEndDate) + '18:00:00' ,0) +

  RangeMax(NetWorkDays(vEndDate+1,vEndDate-1,Feriados),0)*8/24

jacekselega
New Contributor

Re: Counting hours between working hours and days

We starts at 7 am from Mon to Friday. It's 8 hours daily.

Employee
Employee

Re: Counting hours between working hours and days

you can use my expression as starting point, making your adjusments

Community Browser