Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Converting long File name string into date

shelbyswartz
6 - Meteoroid

Hello! I am very new to Alteryx and have a workflow where I am bringing in multiple excel files and adding the output file name as a field. I have a Formula that takes the file path that precedes what is shown below but I would like to remove everything else and have the output as a date.

 

 

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @shelbyswartz one approach would be to use regex. I've mocked up a workflow let me know what you think? As you mentioned your are new to Alteryx I would recommend the Alteryx parsing lessons.

 

Regex_02042021.JPG

apathetichell
19 - Altair

(\d*)\.(\d*)\.(\d*)

 

In regex tool - set to parse.

 

Then use date/time tool and you can extract the information to dates.

Luke_C
17 - Castor
17 - Castor

To offer a non-regex solution, if the date will always be the first part of the filename you can just use a datetimeparse function. 

 

Attached is an example of both regex (mentioned above) and the parse function. I'd suggest bookmarking this link on datetime functions, it's super helpful!

 

 

Luke_C_0-1617384601837.png

 

shelbyswartz
6 - Meteoroid

That worked!! Thank you. I do need to learn parsing.

Labels
Top Solution Authors