How Can I Remove Certain Characters from a Field?
Lets say you have a field called "Rank" and the values are as such: [1st, 2nd, 3rd.. 100th] if you want to remove the suffix in order to make the field numerical you can use this C9 function:
REGEX_REPLACE(Rank,'[(st)(nd)(rd)(th)]','')*1.0
This syntax works as well:
REGEX_REPLACE(Rank, '["st"\"nd"\"rd"\"th")]', '')*1.0
Make sure to add the *1.0 to force the new field into numerical
If you have a field and you want to remove parenthesis, quotes, percent symbols, commas, currency symbols this can be applied to those as well
REGEX_REPLACE(Text, '[(\)]', '') in this case we are removing parenthesis, the \ is used to separate the symbols. You can remove as many characters as you want as long as they are separated by \
Please sign in to leave a comment.
0 comments