Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

need help parsing string field to get numbers

wtan
5 - Atom

I have a column that generally follows the following format: "# years, # months, # days". What I want to do is basically split the column into 3 new columns that have the number of years, months, and days. Normally, this could be done pretty quickly if the formatting stays consistent.

 

But there might not be an "s" if the numbers are just "1": "1 year, 1 month, 1 day".

 

Also, there need not be 3 numbers. For example: "2 years, 7 days" or "1 month, 28 days" or "5 years, 15 days" or "21 days".

 

I have a feeling this is going to need a long and complicated regex expression, so I really appreciate whatever help you can share.

1 REPLY 1
wtan
5 - Atom

Never mind, I just realized I can use datediff( ) on the appropiate columns for a much simpler solution.

Labels
Top Solution Authors