community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Convert String Duration to HH:MM:SS

Asteroid

I've got some durations data as strings which I'm having trouble converting to time values because many of them are over 24 hours.  Is there some format I can convert them to that would allow me to sort them by duration.

 

Duration
26:42:41
105:53:56
50:08:01
21:22:50
73:42:05
108:08:11
1:55:12

 

Thank you for your help.

Alteryx Certified Partner

@DHB 

 

Your best bet would be to PADLEFT() the Duration field to a length of 9 padding 0's at the start. This would then allow you to sort the data 

PADLEFT([Duration], 9, '0')

image.png

 

Hope this helps!

Jimmy
Teknion Data Solutions

Hi DHB,

 

Put in a text to columns tool, splitting on ":"

Then put in a formula, where you convert them all to minutes (e.g., time = hour*60 + minutes + seconds/60)

 

Hope this helps

Asteroid

Thank you both for your solutions - I've cracked it now.

Labels