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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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
Partner - Champion III
Partner - Champion III

See this discussion: Task/Ticket Duration

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


talk is cheap, supply exceeds demand