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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Working Hours not filtering

Hi all, here's a mystery. I'm trying to calculate the working hours between two dates:

Start Time and End Time.

here's the script:

Interval(

     rangesum(

          NetWorkDays(start_time+1,End_time-1,$(vHol)) * MakeTime(10) 

     ,if(NetWorkDays(End_time,End_time,$(vHol)),Rangemin(rangemax(frac(End_time),maketime(8)),maketime(18))-Rangemax(rangemin(frac(End_time),maketime(8)),maketime(8)),0) // working hours last day

,if(NetWorkDays(start_time,start_time,$(vHol)),Rangemin(rangemax(frac(start_time),maketime(18)),maketime(18))-Rangemax(rangemin(frac(start_time),maketime(18)),maketime(8)),0) // working hours first day

,if(NetWorkDays(start_time,start_time,$(vHol)) and floor(start_time)=floor(End_time),-MakeTime(10))

)

)

as WorkingHours

Then the Expresion

SUM({$<WorkingHours=  {"$(='>' & '00:00:00' & '<' & '08:00:00')"}, GroupID={'2'}>} Value)

table.jpg

As you can see in the picture there are some values that aren't fitting into the <8 hours:

Start = End time is 0 and no clue why, next one is 00:03:05 (far away from 08:00:00) but also doesn't come into <8. Expresion is workin 'cos there are others working

Any idea? some clues?

Best regards!

0 Replies