We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculating Time In & Time Out and Break Time

towong
7 - Meteor

I am struggling to find a good way to achieve the following. Hoping someone can provide some sugguestion on this. Thank you in advance:

 

Employee Name

Employee NameTime In_NewTime Out_NewDuration (Hours)
A4/4/2019 23:304/4/2019 6:307
A4/5/2019 9:004/5/2019 12:003
A4/5/2019 14:004/5/2019 18:004
A4/5/2019 19:004/5/2019 20:301.5
A4/8/2019 8:304/8/2019 12:304
A4/8/2019 14:304/8/2019 19:004.5
A4/9/2019 10:004/9/2019 13:003
A4/9/2019 14:004/9/2019 20:006
A4/10/2019 12:004/10/2019 15:003
A4/10/2019 16:004/10/2019 19:303.5
A4/11/2019 12:304/11/2019 15:002.5

 

 In table above for employee A, on 4th-Apr, he worked from 4th Apr 23:30pm to 5th Apr 6:30am (i.e. he worked over from 1 day to the next. Then he started work again on 5th Apr from 9am to 12pm follow by a break of 2 hours and started working from 2pm to 6pm...so on and so forth. I need to have a report that is able to calculate the total hours of no break, anything less than 5 hours between out time and in time is considered as no break. So in the above scenario he worked from 4th Apr 23:30pm to 5th Apr 6:30am (worked across midnight from one day to the next), once this occur, I will need to look at whether he has any breaks of >5 hours the next day (i.e. 5th Apr). So as you can see employee A worked from 4th Apr till 5th Apr with no breaks in between of >= 5 hours till the end of day on 5th Apr.

 

So in this case I will need to flag this out like:

 

Employee NameDayTotal Hours with no breaks
A4/4/201915
2 REPLIES 2
LukeM
Alteryx Alumni (Retired)

Hi @towong,

 

Please see attached for the solution to your problem. This uses multi-row formula tools to first calculate the break between the finish time and the next start time and then to calculate the cumulative working time as long as the break is less than 5 hours.

 

04-06-19.PNG

 

If you need you can then filter for where the Break flag is true to find the longest time employee A works before a break.

 

Let us know how you get on with this.

 

Luke

afv2688
16 - Nebula
16 - Nebula

Hello @towong ,

 

Hope this helps:

 

Untitled.png

 

Cheers

Labels
Top Solution Authors