Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Remove comma from number within a text field

phoebe_kelley
9 - Comet

Hi, I have a text field (an ingredient statement) and I want to remove the commas from any numbers within the text, but not commas that aren't part of a number.

 

for example, here is an ingredient statement:

WATER (AQUA), ORGANIC ALOE BARBADENSIS (ALOE) LEAF GEL*, TOCOPHERYL ACETATE (VITAMIN E 25,000 IU/100G), CARTHAMUS TINCTORIUS (SAFFLOWER) OLEOSOMES, CETEARYL ALCOHOL, PROPANEDIOL (CORN), CETEARYL GLUCOSIDE, ORGANIC COCOS NUCIFERA (COCONUT) WATER*.

 

I want to remove the comma from 25,000 but not the comma delimiters between ingredients.

 

Any ideas? Fancy RegEx?

 

I found that [0-9]+[,][0-9]+ will find the comma surrounded by numbers (the find text for the example above is "25,000"), but I can't seem to figure out how to only replace the comma and not the numbers around it.

 

Thanks for any help!

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @phoebe_kelley 

 

A simple expression would be this

 

REGEX_Replace (Field, "(\d),(\d)", "$1$2")

 

Cheers,

phoebe_kelley
9 - Comet

Perfect, thank you so much!

Labels