Hello,
I've researched a few current thread about date format but I haven't able to resolve my date conversion to Alteryx format.
My date column has different format such as: YYYY-MM-DD, mm/dd/yyyy, m/dd/yyyy, m/d/yyyy (with each letter represent 1 number, 2 letter represent 2 numbers) and also blank. The one with the correct Alteryx format is YYYY-MM-DD I don't want to touch that.
I used the Multi field formula to populate the Regex and Datetimeparse to convert my date format but it gave me the error (see attached screenshot)
Can someone please help how I correct the formula below to get the conversion run?
IF REGEX_Match([Hire Date], '(\d{2}/\d{2}/\d{4})') THEN
DateTimeParse([Hire Date],"%Y/%m/%d")
ELSEIF REGEX_Match([Hire Date], '(\d{4}/\d{2}/\d{2})') THEN
DateTimeParse([Hire Date],"%Y/%m/%d")
ELSEIF REGEX_Match([Hire Date], '(\d{4}-\d{2}-\d{2})') THEN
DateTimeParse([Hire Date],"%Y-%m-%d")
ELSEIF REGEX_Match([Hire Date], '(\d{2}-\w+-\d{4})') THEN
DateTimeParse([Hire Date],"%Y/%m/%d")
ELSEIF REGEX_Match([Hire Date], '(\d{4}/\d{2}/\d{2})') THEN
DateTimeParse([Hire Date],"%Y/%m/%d")
ELSE
NULL()
ENDIF