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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

shifts per time

Hello,

i have following problem. I want to define 3 shifts-> Early, Late and Night. I have an field with an time/datestamp as follow

26.01.2016 22:00:12

The Earlyshift is from 06:00:00 to 13:59:59

      Lateshift from 14:00:00 to 21:59:59 and the

      Nightshift from 22:00:00 to 05:59:59.

How can i solve my problem?

Labels (1)
3 Replies
amit_saini
Master III
Master III

sunny_talwar

In the script? May be like this:

If(TimeStamp(TimeStampField) >= MakeTime(6, 0, 0) and TimeStamp(TimeStampField) <= MakeTime(13, 59, 59), 'Earlyshift',

If(TimeStamp(TimeStampField) >= MakeTime(14, 0, 0) and TimeStamp(TimeStampField) <= MakeTime(21, 59, 59), 'Lateshift', 'Nightshift') as Shift

Anonymous
Not applicable
Author

1st extract time from this field like?

Interval(YourDateTimeField)

then at script with IF condition like this?

=if(Interval(YourDateTimeField)>=Interval('06:00:00') and Interval(YourDateTimeField)>=Interval('13:59:59'),'Earlyshift',

if(Interval(YourDateTimeField)>=Interval('14:00:00') and Interval(YourDateTimeField)>=Interval('21:59:59'),'Lateshift ',

if(Interval(YourDateTimeField)>=Interval('22:00:00') and Interval(YourDateTimeField)>=Interval('05:59:59'),'Nightshift '))) as shift