Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
ID | Date |
1 | 10/04/2016 06:00 |
2 | 10/04/2016 08:00 |
3 | 10/04/2016 12:00 |
4 | 10/04/2016 14:00 |
5 | 10/04/2016 18:00 |
6 | 11/04/2016 05:00 |
7 | 11/04/2016 10:00 |
8 | 11/04/2016 22:00 |
9 | 11/04/2016 23:00 |
10 | 11/04/2016 03:00 |
11 | 11/04/2016 01:00 |
12 | 11/04/2016 01:00 |
13 | 11/04/2016 04:00 |
14 | 12/04/2016 14:00 |
15 | 12/04/2016 06:00 |
I need count shift by shift (diferent count)
Best regards.
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.