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.

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
21 - Polaris
21 - Polaris

@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
Top Solution Authors