Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

extracting date from a string

vamsey
8 - Asteroid

Hi Alteryx Community,

 

I have columns as shown below.

loan activites 12/11/2021 12.00.00
loan activites_NA 12/11/2021 11.33.99

 

I have to extract date from the string. Can anyone help 

6 REPLIES 6
PhilipMannering
16 - Nebula
16 - Nebula

Hi @vamsey 

 

You can use the Text-to-Columns Tool, and split on a space.

PhilipMannering_0-1636630453365.png

 

afv2688
16 - Nebula
16 - Nebula

Hello @vamsey ,

 

You might also try using regex:

 

 

DateTimeParse(
REGEX_Replace([Field1], '.*\s(\d+/\d+/\d+).*', '$1'), '%d/%m/%y')

 

 

Untitled.png

 

Regards

mceleavey
17 - Castor
17 - Castor

Hi @vamsey ,

 

in addition to what @PhilipMannering said, you could regex to parse out the mask:

 

mceleavey_0-1636631226169.png

mceleavey_0-1636631312676.png

 

 

mceleavey_1-1636631241024.png

 

Workflow attached.

I hope this helps,

 

M.

 



Bulien

vamsey
8 - Asteroid

below columns are not able to output the dates using the formulae. Can you please help

 

 

Report free of Soan BQ Outstanding Activities_11-08-2021 17-30-45.0000000.xlsx
Report free of Soan BQ Outstanding Activities_11-09-2021 17-30-36.0000000.xlsx
Report free of Soan BQ Outstanding Activities_11-10-2021 17-30-41.0000000.xlsx

Report free of Soan BQOutstanding Activities_NA 11-08-2021 17-30-45.0000000.xlsx
Report view of Loan IQdfd Outstanding Activities_NA 11-09-2021 17-30-36.0000000.xlsx
Report view of Loan IQed Outstanding Activities_NA 11-10-2021 17-30-41.0000000.xlsx

 

 

 

 

HomesickSurfer
12 - Quasar

Hi @vamsey 

 

Try GetWord([Field], 2)

mceleavey
17 - Castor
17 - Castor

Hi @vamsey ,

 

change the regex in my Regex tool to the following:

 

(\d\d[/]\d\d[/]\d{4}|\d\d[-]\d\d[-]\d{4})

 

mceleavey_0-1636637542008.png

 

You'll need to change the name back to Date or whatever.

 

M.

 



Bulien

Labels
Top Solution Authors