# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Contributor III

## Finding Shift Time Difference..

Hi,

I have set of data's given below.

 Emp ShiftInTime ShiftOuttime PunchinTime PunchOutTime A 8:00 20:00 8:35 21:30 A 9:30 21:30 9:31 21:15 B 10:00 22:00 9:32 21:45 C 10:00 22:00 9:59 22:01 D 11:30 23:30 11:15 23:15 E 5:30 17:30 7:00 17:15

I want to calculate the person's who active who came >15 mts, who left >5mts, who came >30 mts based on their shiftintime & outtime for each employee.

Could anyone help me with this

4 Replies
MVP

## Re: Finding Shift Time Difference..

You want this calculation in the script or front end?

Contributor III

## Re: Finding Shift Time Difference..

Anything is fine. But i need in front end.

Thanks

MVP

## Re: Finding Shift Time Difference..

May be create flags?

Table:

ShiftInTime,

ShiftOuttime,

PunchinTime,

PunchOutTime,

If(PunchinTime - ShiftInTime > MakeTime(0, 15), 1, 0) as [15MinsLate],

If(PunchinTime - ShiftInTime > MakeTime(0, 30), 1, 0) as [30MinsLate],

If(PunchOutTime - ShiftOuttime > MakeTime(0, 5), 1, 0) as [5MinsLate]

FROM

(html, codepage is 1252, embedded labels, table is @1);

This may not be what you want, but I thought you can use this flags to do any calculations you might want to do.

Contributor III

## Re: Finding Shift Time Difference..

Hi Sunny,

If the person came 15mts late, then he won't be appear in 30mins late. See the above image,

Emp  Punchintime   shiftintime

A       8.35               8.00                          but he is coming in all the categories. Verify it.

Actually i want my output in frontend.

like this,   15mts late, 15mts earlier,between 15mts earlier to 15 mts late

Thanks.

Community Browser