Hello all,
I am trying to figure out a formula that can easily figure out the difference between two times (HHmm) in Alteryx. Military time is what I need to use. (1530-930 = 6 hours) Visual example below:
Hi @deckthehalls
This formula should do the trick. It parses each time into an alteryx read-able format and then applies the datetimediff function. The below link is super helpful in breaking down each datetime function.
DateTime Functions | Alteryx Help
Datetimediff( Datetimeparse(padleft(tostring([End Time]),4,'0'),'%H%M'), Datetimeparse(padleft(tostring([Start Time]),4,'0'),'%H%M'),'hours')
@deckthehalls Another way of doing this with the DateTime Tool
This worked perfectly for what I needed. Thanks!
@deckthehalls Happy to help! Don't forget to mark the solutions so others can find them easier.
@deckthehalls please do mark the answer you like as a solution as it helps others find answers faster and respects the assistance provided by the contributor