Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Splitting a date time range into hours

jjdennis
7 - Meteor

I am looking to compare downtime and production to labor data on an hourly or half hourly basis.  My challenge is for my labor data I have a range (punch in to punch out) which I need to put into a 24 hours timeline without dates.  We are trying to look at our labor effectiveness over the course of the day to get production/labor hour on an hourly basis to understand if lines are more or less production during different parts of the day or shift.

 

Can someone help me figure out how I would go about doing this for the example below?  Thanks!!!

 

Example:

 

Range:

Punch In 6/14/2018 20:15 Punch Out: 6/15/18 5:15

 

Needed Result:

Hours worked during each hours time period:

Hour 20:00-21:00 - .75 hour

Hour 21:00-22:00 - 1 hour

Hour 22:00-23:00 - 1 hour

Hour 23:00-00:00 - 1 hour

Hour 00:00-01:00 - 1 hour

Hour 01:00-02:00 - 1 hour

Hour 02:00-03:00 - 1 hour

Hour 03:00-04:00 - 1 hour

Hour 04:00-05:00 - 1 hour

Hour 05:00-06:00 - .15 hour

Hour 06:00-07:00 - 0 hour

...

4 REPLIES 4
danrh
13 - Pulsar

Something like this should get you close:

image.png

jjdennis
7 - Meteor

Thanks!

nisarghande
6 - Meteoroid

I have little different problem, I have two different column "Start Session and End Session, I want to Calculate Time(duration) between this columns, and show time(duration) into three different categories, 1.Short, 2.Medium, 3.Long. Kindly provide solution provide for this, I am attaching xlsx file, Alteryx Community help me out for this.

 

 

danrh
13 - Pulsar

Hey @nisarghande, I highly suggest you start a new thread for situations like this and then just reference this thread is you want to draw on it - otherwise, you run the risk that everyone will see that this post has a solution and won't think there are additional questions to be answered.

 

That being said, you should be able to do all this in a single Formula tool (though the first formula is a bit convoluted). See attached. This shows the duration in minutes and separates the records into Categories based on 30 minute intervals. You will have to play with this until it's set where you need it.

Labels