Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

IF Statement with Wildard in IN

Highlighted
5 - Atom

Hello

How do i add a wildcard to the IN ( ) of an IF Statement so i don't have to enter all these variables?

example:

IF [Custom 10 - Name] IN ("COV", "COV WFH", "COV WFH new service", "COVID WFH", "COV - WFH", "COV- WFH", "COVI", "COVI LUNCH")  then "Y" else "" endif

Highlighted
10 - Fireball

HI @LisaLeach 

 

You can't add a wildcard to the list of values but you may be able to use the below formula instead.

 

IF REGEX_MATCH([Custom 10 - Name], "COV.*") THEN "Y"

ELSE ""

ENDIF

 

Best,

Michael

Highlighted
13 - Pulsar

Hi @LisaLeach 

 

You can also use a Contains function: IF Contains([Custom 10-10,"COV") THEN "Y" ELSE "" ENDIF

Highlighted
5 - Atom

Thank you but that didn't work for me.

Highlighted
5 - Atom

Hi @T_Willins 

Thank you for your reply but that solution did not work for me.

Take Care

Lisa

Highlighted
10 - Fireball

Hi @LisaLeach 

 

Can you provide a sample dataset and explain what didn't work.

 

I suspect that you have other records that are getting flagged when they shouldn't be. Is that right?

 

Best,

Michael

Labels