Alteryx Designer Desktop Discussions

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

EXTRACTING THE DIGITS AND RETAIN THE SPECIFIC DIGITS

dunkindonut7777
8 - Asteroid

Hi I would just like to ask if how can I the first 5 digits in this value:

USD1280007021502

 

Expected output:

12800

 

I want to remove the USD also and retain the first 5 digits after USD.

2 REPLIES 2
Qiu
20 - Arcturus
20 - Arcturus

@dunkindonut7777 
We can either use a SubString function or Regex for tihs purpose.

0608-dunkindonut7777.PNG

CarliE
Alteryx Alumni (Retired)

@dunkindonut7777 ,

 

if it is not always USD, but it is the first 5 digits after letters, you can do this regular expression:

 

\D+(\d{5})\d+

 

\D = any non digit

\d{n} = specific number of digits

() = the capturing group

 

regex101.com is a SUPER helpful site to test your regular expressions.

 

If this solution was helpful, please mark as a solution to help the other members on the community out!

 

Thanks :)

Carli
Labels