Calculating hours between two dates/times but ignoring any hours before or after specified times
Quite new to Qlikview, so struggling a little with this one - I am trying to calculate the number of hours between two date/time fields in my script, but ignoring any hours before 9am or after 5pm on Mon, Tues, Thurs & Fri and after 1pm on Wednesdays. For example if I have an activity that starts at 8am and finishes at 12pm, I only want to report 3 hours, and similarly if I have an activity that starts at 4pm and finishes at 6pm I only want to report 1 hour. I hope this makes sense.
Re: Calculating hours between two dates/times but ignoring any hours before or after specified times
you should use Interval() function to calculate hours between two date, and make sure your date/time field is correctly evaluated and formatted using Date#() and Date() functions or Timestamp#() and Timestamp() functions.
to ignore hours before or after you can use an if condition before using interval().