cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Announcement | Looking to expand your Alteryx skillset?! Check out the latest set of interactive lessons in Alteryx Academy: Creating Analytic Apps
SOLVED

contains multiple strings?

Highlighted
Asteroid

i read this - https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Filter-on-Multiple-Contains/m-p/309402

 

but what i need is something like :

 

contains([field1], "mustang" or "fiesta" or "f150") to change a set of values, based on the value of a field, in this case, the nameplate field or do i have to do:

Contains([field1],"mustang") OR

Contains([field1]),"fiesta")

 

thanks

 

Alteryx Partner

You could instead use something like:

 

REGEX_Match([Field1], 'mustang|fiesta|f150')

Let me know if you have more questions about building the regex, or if this doesn't work for you.

 

Cheers!

Asteroid

thanks.  can you use that with a formula tool so I can change the value of the field [wheelbase] based on values in the field [nameplate]?  thanks

 

Asteroid

REGEX_Match([nameplate],"Mustang"|"Figo") doesn't work, even If I use 'Mustang' or double quotes.  the error , in the formula tool is "unknown operator "|", did you mean "||"? and if I put that in, then I can't change the field "wheelbase" in formula since it's a numeric. 

Alteryx Partner

Yes, you'd want to enter an expression something like:

 

IF REGEX_Match([Field1], 'mustang|fiesta|f150')
THEN Value1
ELSE Value2
ENDIF

This should do what you want. If you can provide a sample of data I could try to put an actual example together.

 

Let me know if you need further help setting this up.

Alteryx Partner

You want the | character inside the quotes. 

 

The second argument should be a single string, with things you want to look for separated by |.

 

The | (pipe operator) is used to mean the logical OR operation.

Asteroid

thanks!  and duh, I need to read for context not for speed! 

Labels