Alteryx Designer Desktop Discussions

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

HOW TO REMOVE DIGITS IN A STRING

dunkindonut7777
8 - Asteroid

Hi how can I remove the number "1" in the string "1 TOTAL ACCUM DEPN". What is the formula for this?

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

You can use formula like this

 

Trim(Replace([Field1], "1", ""))

 

Hope this helps : )

dunkindonut7777
8 - Asteroid

Hi how about if I have a lot of numbers in a string?

atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

Try formula like this

 

Trim(REGEX_Replace([Field1], "\d", ""))

 

Hope this helps : )

MarqueeCrew
20 - Arcturus
20 - Arcturus

@dunkindonut7777 ,

 

 an alternative to the use of RegEx (more expensive),

 

 

replacechar([field],"1234567890",'')

 

 this will replace anything in the quotes with nothing. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
robertbrussell1
6 - Meteoroid

This was very helpful. Can you also remove leading and trialing spaces?  I assume this would be a conditional statement such as IF LEFT(1) =  '  ' THEN TRIM .... but there's probably a simpler solution.

Labels