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

Alteryx Designer Desktop Discussions

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

IF Statement with Wildard in IN

LisaLeach
6 - Meteoroid

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

5 REPLIES 5
MichaelLaRose
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

T_Willins
14 - Magnetar
14 - Magnetar

Hi @LisaLeach 

 

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

LisaLeach
6 - Meteoroid

Thank you but that didn't work for me.

LisaLeach
6 - Meteoroid

Hi @T_Willins 

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

Take Care

Lisa

MichaelLaRose
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