In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more 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