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. 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

IF Regular Expression: find specific digits and return a value

jf97hernandez
7 - Meteor

Dear all,

 

I am trying to use a formula tool with a RegEx to return a value based on part of a text. More specifically, if the text is 1-187698, the return should be "One"; and if the text is 09-567-09870, the return should be "Two". So pretty much I am trying to look how many digits before the first dash, and based on that condition it returns the corresponding value.

I tried using an IF Left formula to no avail, and also using a regular expression tool to no avail.

 

CriteriaSolution
1-187698One
09-567-09870Two
9-925612One
15-981-16578Two
99-909-12986Two

 

Thank you in advance for your time and assistance, and I wish you all a great weekend.

 

Best,

Jf97hernandez

1 REPLY 1
AngelosPachis
16 - Nebula

Hi @jf97hernandez ,

 

You can make use of the findstring embedded formula in the formula tool

 

AngelosPachis_0-1611350360267.png

 

Have a good weekend 

 

Regards,

 

Angelos

Labels
Top Solution Authors