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
6 - Meteoroid

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
20 - Arcturus
fieldew1
6 - Meteoroid

@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
6 - Meteoroid

Thank you! This seems to work :)

Labels