Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Extracting date text from string using Alteryx

Sujitra_Rajan
5 - Atom

Hi all,

 

I'm newbie to Alteryx, am stuck and reaching out for help if anyone could help guide which tools to use and share workflow that will help extract the date from description in a column.

 

Eg. CAOM 3043 Cash recd 20190601 Rein

      CAOM 3043 FX Adj 20190601 Rein

      CAOM 3043 Recd stmt 20190601 Rein

      CAOM 3043 Accrual 20190601 Rein

 

Have attached sample here for easy reference. Looking forward to your response and thanks in advance for your time and effort in looking into this. Much appreciated :)

 

Thanks,

Sujitra

6 REPLIES 6
ShankerV
17 - Castor

Hi @Sujitra_Rajan 

 

One way of doing this.

 

ShankerV_0-1676465967957.png

 

Many thanks

Shanker V

Felipe_Ribeir0
16 - Nebula

Hi @Sujitra_Rajan 

 

One way of doing this: 

 

Felipe_Ribeir0_0-1676466682020.png

 

ShankerV
17 - Castor

Hi @Sujitra_Rajan 

 

One more way to do it with the help of Formula tool.

 

ShankerV_0-1676466825087.png

 

Many thanks

Shanker V

BS_THE_ANALYST
13 - Pulsar

Couple of ways to approach this:
Method 1: I'd definitely use the trim function to clean up spaces before and after the strings:

BS_THE_ANALYST_0-1676466399777.png

Method 1.2: You can use the Right function, and then use Text to Columns. (this isn't the best option in my opinion, but it's one to explore)

Using Right function:

BS_THE_ANALYST_1-1676466589509.png

Using Text to Columns: Make sure you enter a space in the Delimeters section in the configuation

BS_THE_ANALYST_2-1676466686103.png

 

 

Method 2: RegEx (way more dynamic). Using the RegEx tool. If the date always sits in the second to last word position, it will find it. 

BS_THE_ANALYST_6-1676468131700.png

 


 
 

 

 

Method 3: Given that there are no other 8 digit numbers in the string, RegEx:

BS_THE_ANALYST_4-1676467205404.png

 



 

 

cjaneczko
13 - Pulsar

This was the method I was going to propose. Regex tool parsed on the 8 digits. 

Sujitra_Rajan
5 - Atom

Thank you! The regex parse tool worked!

Labels