community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Return only numbers from a string using formula tool

Asteroid

Hi,

 

How to return only numbers using formula tool from a string that contains alphas, numbers and special characters also.

 

Thanks,

Prasad

Alteryx Certified Partner
Alteryx Certified Partner

put this in the formula: REGEX_Replace([Field1], "[[:alpha:]]", "")

Alteryx Certified Partner
Alteryx Certified Partner

If there are some special characters in the set, just add | + "special character".

 

For example, if you want also to remove @:   REGEX_Replace([Field1], "[[:alpha:]]|@", "")

Quasar

as an alternative, you could use 

 

regex_replace([Field],"\D+",null())

were the \D is anything that is a non-digit. This would eliminate the need to specify non-alpha characters.

Asteroid

Thanks for the reply.I have used the Data Cleansing tool for the same.

Labels