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: 
mszuberl
Contributor III
Contributor III

Working with timestamps

Hi,

I have a table, in which I store timeclock data (employee id, employee punch in time and date, employee punch out time and date).

See Sample attached.

33.PNG

All employees who work more than 5 hours in a single shift, qualify for a 30 minute paid lunch break.

In the example below, records 1 and 5 would qualify for a lunch break.

Record 1 is easy to adjust.

However, record 5 spans across two days (3 hours on 01/10/2016 and 3.5 hours on 1/11/2016). In these situations, I need to subtract 30 minutes from Hours Worked on a day with more hours worked (1/11/2016).

Following the adjustment, Hours worked would be: 3 hours on 01/10/2016 and 3 hours on 1/11/2016.

How can I accomplish this in script?

Thank you very much in advance!

Marcin

1 Reply
Gysbert_Wassenaar

See this discussion: Task/Ticket Duration

or this one: Calculate hours between two Date/Time strings


talk is cheap, supply exceeds demand