Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to extract a certain string/number?

fieldew1
7 - Meteor

Hi, I'm trying to figure out how to extract a certain string/number. I have a different UNIT Id, some just a string of 5 numbers some include a letter and two numbers. I have tried the following formula ToNumber(REGEX_Replace([Business unit path],"^.*?(\d{5}(.\d{1,2})?).*?$","$1")) but this gives me only a string of numbers. I have attached a picture with both values which need to be found.

5 REPLIES 5
Deano478
12 - Quasar

@fieldew1 its very hard to help you with this issue as we cant see the rest of the string preceding the values you need can you anonymize the strings and post them here?

binuacs
21 - Polaris
fieldew1
7 - Meteor

@binuacs thank you for the solution, unfortunately, it brings back NULLS.

The string looks like below

AAAA > Newcastle > K884 - Newcastle A (121212)
BBBB> Northampton > 99863 - Northampton A (123456)

Deano478
12 - Quasar

@fieldew1 if this is your data structure you can try this approach:


fieldew1
7 - Meteor

Thank you! This seems to work :)

Labels
Top Solution Authors