Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

¿Count by range/shift (in hours) in date?

Hi there,

I need to count the ID that are into the followings diferents shifts:

Shift 1  6:00 to 14:00

Shift 2  14:00 to 22:00

Shift 3   22:00 to 6:00

My source is like:

IDDate
110/04/2016 06:00
210/04/2016 08:00
310/04/2016 12:00
410/04/2016 14:00
510/04/2016 18:00
611/04/2016 05:00
711/04/2016 10:00
811/04/2016 22:00
911/04/2016 23:00
1011/04/2016 03:00
1111/04/2016 01:00
1211/04/2016 01:00
1311/04/2016 04:00
1412/04/2016 14:00
1512/04/2016 06:00

I need count shift by shift (diferent count)

Best regards.

1 Reply
johnw
Champion III
Champion III

I'd create a shift field during the load of your data.

if(hour(Date)<6,1
,if(hour(Date)<14,2
,if(hour(Date)<22,3,1))) as Shift

Then use Shift as the dimension.