Alteryx Designer Desktop Discussions

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

Filter a column records that contains a list of strings

fitch1892
7 - Meteor

I have  a large data set and im trying to filter out all the records in a column that contain a string in a list of strings. I tried using a filter; [field1] in ("cat", "hat", "bat", "nap"). This works but doesnt actually capture all the records that contains these strings. What am i doing wrong?

 

For instance, "dog and the cat", is not coming out in the true portion.

 

 

Fyi this data is fictitious for privacy reasons.

3 REPLIES 3
Luke_C
17 - Castor

Hi @fitch1892 

 

The IN function looks for exact matches. You would need to use the Contains() function which unfortunately only allows one value to be passed, so you'd need something like: 

Contains([Field1],'cat') OR Contains([Field1],'hat') OR ......

 

You could also consider using a find and replace tool to append the matching keyword and filter on that. If you share some sample data it'd be helpful.

Emmanuel_G
13 - Pulsar

Hi @fitch1892 ,

 

Do you want something like this ? ( Contains is insensitive case function by default so "Cat" = "cat" )

 

Emmanuel_G_0-1657905287207.png

 

fitch1892
7 - Meteor

That works. I went ahead and just used the contains function which worked perfectly.

Labels