Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
josecanalla
Creator
Creator

Identify two consecutive dates and get hours difference between it

Hello, I have this data from a fingerprint device:

IDEmployee IDChecktimeChecktype
1126/10/17 08:00:00In
2226/10/17 08:10:00In
3326/10/17 08:11:00In
4226/10/1710:10:00Out
5126/10/17 12:10:00Out
6326/10/17 15:00:00Out
7.........

I want to know the hours worked for every employee in every day. For example I want to get:

Employee IDDateHours worked
126/10/176
226/10/178
3......

So I need to get from every "In" row the next "Out" row for the same Employee ID and get the difference in hours between two dates.

Any suggestion? Thanks!

15 Replies
sunny_talwar

I am not sure I understand.. can you share a sample to check this out?

josecanalla
Creator
Creator
Author

I get error loading script: "Field CheckTime not found"

josecanalla
Creator
Creator
Author

In your first response you say that I have to put two dimensions: EmployeeID and Date.

In what way can I get the "Date" dimension? Only I have timestamps.

sunny_talwar

You can create a date field in the script like this

Date(Floor(checktime)) as Date

simon_minifie
Partner - Creator III
Partner - Creator III

Take out the drop table.

It shouldn't happen, but sounds like the two tables are auto concatenating.

Thanks,

Smon

cazztfplease
Creator
Creator

I had to do something similar in one of my projects for a help ticket tracker.

In your scenario, you could just replace the 'created' field value with your 'Clock-in' value and the 'resolved' field value with your 'clock-out' value.  I would imagine similar results.

Comm.PNG

Resolution Time expression is:

Interval(interval#(ceil(($(vResolutionTime))),'s'), 'dd:hh:mm:ss') 

where the variable is defined  as:

(resolved - created) *86400