Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Is there another way to perform IF Contains function with a list of keywords

ELPC
8 - Asteroid

Hi all, 

I have a file with payment detail and I'm trying strip out the Manufacturer of a product from a Text field into a separate column.  I have used the Contains function within the Formula tool to do this. However, since this is directly coded in the workflow, whenever there is another keyword to search for, I have to go back into the workflow to add it to the formula.  Is there another way I can do this with an input from an excel file so the user can input the new keywords and what it should return?  Thank you!  

 

Example below:  If the Text field contains any of the words Acrobat, After Effects, Flash Pro, Dreamweaver, Framemaker, or Illustrator, then return "Adobe" in a new Manufacturers field.  Note that this is just one example and there are other keywords that need to return other manufacturers in my actual 50 line formula!  

 

IF Contains([Item Text], "Adobe") THEN "Adobe"

ELSEIF Contains([Item Text], "Acrobat") THEN "Adobe"
ELSEIF Contains([Item Text], "After Effects") THEN "Adobe"
ELSEIF Contains([Item Text], "Flash Pro") THEN "Adobe"
ELSEIF Contains([Item Text], "Dreamweaver") THEN "Adobe"
ELSEIF Contains([Item Text], "Framemaker") THEN "Adobe"
ELSEIF Contains([Item Text], "Illustrator") THEN "Adobe"

ELSE "" ENDIF

2 REPLIES 2
DavidP
17 - Castor
17 - Castor

You can use Find Replace tool

 

DavidP_0-1594767856438.png

 

ELPC
8 - Asteroid

I knew it had to be something simple that I was just not thinking of!  That totally worked!  Thank you.  

Labels
Top Solution Authors