Alteryx Designer Desktop Discussions

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

How to check if a field has special characters using formula

Vaib
8 - Asteroid

I want to check if a column has any of the below special characters:

&

@

!

#

%

^

*

/

?

 

What formula can I use to check this

2 REPLIES 2
apathetichell
18 - Pollux

REGEX_Match([Field1], ".*[\&@\!#\%\^\*/\?].*")

 

create a new boolean field for this and it will be True if it contains any of those characters...

echuong1
Alteryx Alumni (Retired)

Three options for you:

 

Regex - you can use the match function with each of the special characters you're looking for listed in the expression. It will output a True or False if it contains one of the characters.

 

Formula - with the regexmatch() function, you can specify the characters you're looking for. This is the same as the above, just in formula form.

 

Find and replace - you can have a reference table of the characters you're looking for. You can choose to append the character found to the row. If the appended field is filled in, you know there was a character from the list present. If it remains null, you know it doesn't contain any of them. You can then use a formula to clean this up. This may be easier to update if your characters will change.

 

echuong1_0-1617134090540.png

 

 

 

Labels