Alteryx Designer Desktop Discussions

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

Filter for one word that has commas

VeronicaElse
8 - Asteroid


Hello,

 

I need to filter out for a certain program but it has the word, plus other additional words in that same column. For ex, I only need chemo and oncology but chemo looks like this--- chemo, J6578 Injection, degarfin, 1 notes--- it has all that in the column as well. It doesnt work when I do filter for chemo but itself.

 

Any suggestions?

7 REPLIES 7
shreyanshrathod
11 - Bolide

@VeronicaElse , if you need only "chemo" or "oncology" from a column, you should consider RegEx Parse.

 

Regards,

Shreyansh

Luke_C
17 - Castor

Hi @VeronicaElse 

 

You could try a custom filter using the contains function, for example:

 

Contains([Field],"chemo") OR Contains([Field],"oncology")

DawnDuong
13 - Pulsar
13 - Pulsar

Hi@VeronicaElse 

What @Luke_C  said is correct. if you want case-insensitive, you can also try Contains([Field],"chemo",1) OR Contains([Field],"oncology",1) as a condition in the filter Tool. Hope this solves your problem.
Dawn.

VeronicaElse
8 - Asteroid

I tried this, but it didn't work. Maybe it has to be case sensitive since it has other words, commas, numbers in that same column? I used this in a filter and for True nothing came out but for False all the files came out?

Luke_C
17 - Castor

@VeronicaElse Can you attach the workflow or share a screenshot of how you have everything configured? It is very tough to say what the issue is without that.

hroderick-thr
11 - Bolide

Maybe replace and compare to base for changes...

If replace(replace(field_1,'chemo',''),'oncology','') = field_1 then 1 else 0 endif

mceleavey
17 - Castor
17 - Castor

Hi @VeronicaElse ,

 

the suggestions made by my esteemed cohorts here will work under certain circumstances, but I'm not sure it's best for what you're trying to do. The regex match function matches the entire string, and so does not work when trying to match individual words in a string.

 

I've tried another way, using the Find and Replace tool which allows you to control which search words you want to match in a text input:

 

mceleavey_0-1623081470774.png

 

This then matches the search words to the string, and includes case insensitive searches:

mceleavey_1-1623081556529.png

 

mceleavey_2-1623081571557.png

 

mceleavey_3-1623081596977.png

 

Hope this helps,

 

M.

 

 

 

 

 

 



Bulien

Labels