Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
andymayo
Contributor III
Contributor III

Determine what shift an employee is on using Activity Date Time

ActionDateTimeEmployee
02/04/2020 08:03JONES
02/04/2020 08:13JONES
02/04/2020 15:38JONES
02/04/2020 16:23JONES
02/04/2020 11:00SMITH
02/04/2020 11:07SMITH
02/04/2020 11:05SMITH
02/04/2020 18:05SMITH
03/04/2020 07:45JONES
03/04/2020 13:58SMITH
  

 

I have Shift Times as Follows

Monday- Thursday the Day Shift Works 

07:30 to 16:00

on a Friday they work 07:30 - 14:30

The Lates Shift Works

10:45am to 20:30 Mon- Thurs and do not work Fridays

I wanted to create a column in my load script called SHIFT and it will either be 'DAY' or 'LATE'  using the Max and Min ActionDateTime each day for each worker determine what shift they are on.

For example if it is Mon-Thurs and the Min(ActionDateTime) is between 07:30 - 10:45 then they are on the Day Shift if the Day is Mon-Thurs Min(ActionDateTime) is between 10:45 - noon then they are on the Late Shift. 

The shift a person is on can change daily and I want to use this calcualtion throught my application not just in an Expression. I want to use it in filters etc..I want to look at lapsed time between first scan and shift start time and last scan and shift end time

Please can you advise. 

 

 

 

Labels (2)
11 Replies
andymayo
Contributor III
Contributor III
Author

 

 

ArnadoSandoval
Specialist II
Specialist II

@andymayo 

Do you have a question?

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.