Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
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.

Tags (4)
1 Reply
MVP
MVP

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

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.