Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Extracting a number from a sentence

rushabh_shah
8 - Asteroid

Hi Team,

 

I am looking to extract a number from a string field. Attaching the sample file with the input and desired output.

 

I tried using the Regex function but unable to get around it. Also, tried the wildcard function used in Excel in the formula node (Replace formula) but in vain.

 

Please help.

 

Regards,

Rushabh

5 REPLIES 5
KaneG
Alteryx Alumni (Retired)

Hi @rushabh_shah,

 

Try this in the REGEX Tool with Parse as the Output Method: (\d{5,})

 

It will find any number over 5 digits, set the 5 to about the minimum it will be, so that you don't pick up other numbers...

rushabh_shah
8 - Asteroid

It is working but in some cases it is sonverting the last digits (say 4,2,7 as examples) to 0

KaneG
Alteryx Alumni (Retired)

I'll need more information as to when that is happening, maybe an example of the starting data and the finishing data for one line that is not working. 

rushabh_shah
8 - Asteroid

Attaching a sample record. 

 

can you please check

KaneG
Alteryx Alumni (Retired)

That example is working fine on my machine. Make sure that your field is set to a string type with enough characters

Labels
Top Solution Authors