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

Alteryx Designer Desktop Discussions

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

remove date from description column while leaving the other details behind

ChloeW
7 - Meteor

hi there!

 

im trying to remove all these dates (highlighted in yellow) from the description into another column while leaving the other details behind. 

however, due to the inconsistent format of the dates in the other cells, i cant seem to find a way to extract all at once.

please help :(

 

extract dates.png

5 REPLIES 5
caltang
17 - Castor
17 - Castor

I see that you tagged this as Designer Cloud - are you sure you’re in the right place? Some functions/tools may be different between Cloud and on-prem Designer.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

I’m on my phone right now, but what you can do - as a high level solution - is to use REGEX match to map out what dates are there. 

You can also use REGEX Replace after you match them to rid them from your data. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

I don’t know if this works but give this Regex a shot:

 

(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])|((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2}, \d{4})

Use the replace function in the Regex tool and replace it with a blank or null()

 

From there, you can use a Data Cleansing tool to rid it of trailing white space / nulls / general white space.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
cjaneczko
13 - Pulsar

Try the below in the RegEx tool. And a Formula Tool after it.

 

(\d{1,2}/\d{1,2}(?:/\d{2,4})?)|((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|)\s+\d{1,2}\s+\d{4})
if IsEmpty([Date1]) then [Date2] else [Date1] endif

 

image.pngimage.png

binuacs
21 - Polaris

@ChloeW One way of doing this

image.png

Labels