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 after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. 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

Extract Number from a String

lac
7 - Meteor

Hello, 

Can someone please help? I'm trying to extract numbers from a field that are followed by the letters CY.

 

so in this example i only want to extract the numbers 2020 from the string below. This number will change but will always be followed by CY or cy

 

U9898 Happy go lucky until 2020CY or until today 321
3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @lac 

 

Here's 2 ways, one regex, one text parsing:

 

Regex:  .*(\d{4})CY.*

Formula: tonumber(substring([Field1],findstring(UPPERCASE([Field1]),'CY')-4,4))

Luke_C_0-1647880408073.png

 

 

binu_acs
21 - Polaris

@lac 

binuacs_0-1647880673119.png

 

lac
7 - Meteor

Thank you this was super helpful

 

Labels
Top Solution Authors