Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Date time format

imivan
8 - Asteroid

44910
44923
44916
44916
44938
44923
44938
44876
44911
44943
44930
44928
44917
44916
44916
44912
44940
44930
44957
44935
44935
44963
7/2/2023
28/12/2022
31/1/2023
44935
44970
44880
44896
44958
17/1/2023
29/11/2022
28/11/2022
13/2/2023
44960
44965
44959
44984
44961
44994
44972
44995
44989
44992
44953
44953
44938
45009

Above are the date data I obtained from an Excel file, I am not supposed to format cell nor hardcode the data but it will show null for those in such format: 7/2/2023. But if I tick the "First row contains data", my header will become one of the data and I still have no clue how to convert them into a uniformed format.

 

2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @imivan ,

 

You can apply the date function for each pattern as below.

I hope this helps.

 

Workflow

Yoshiro_Fujimori_0-1687332231226.png

 

Date Functions in Formulat tool

Output = 

IF REGEX_Match([Data], "\d+")
THEN ToDate(ToNumber([Data]))
ELSEIF REGEX_Match([Data], "\d+\/\d+\/\d{4}")
THEN DateTimeParse([Data],"%d/%m/%Y")
ELSE Null()
ENDIF

 

Output

Yoshiro_Fujimori_1-1687332353516.png

 

imivan
8 - Asteroid

imivan_0-1687332775007.png

I manage to solve it after some brainstorming, yours is definitely smarter and easier, thanks

Labels
Top Solution Authors