Hello
I am still trying to wrap my head around the date aspects of Alteryx and attempting to change a military time to a standard 12 hour time, but to no luck, I understand there are other ways around this but I do not understand why this way in particular does not work, any help would be appreciated.
First formula - this ensures there are four digits in the field
if Length([MILITARY BEGIN_TIME]) < 4
then "0" + [MILITARY BEGIN_TIME]
else [MILITARY BEGIN_TIME]
Endif
Second formula - attempt to replace any first two digits that are greater than 12 - this part does not convert, although it does run with errors
if (ToNumber(left([MILITARY BEGIN_TIME], 2))) > 12
then ((tonumber(Left([MILITARY BEGIN_TIME], 2))) - 12) + ToNumber(right([MILITARY BEGIN_TIME],6))
else ([MILITARY BEGIN_TIME])
endif
Thank you