ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

IF Statement with Wildard in IN

LisaLeach
Meteoro

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 RESPUESTAS 5
MichaelLaRose
Bola de fuego

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
Meteoro

Thank you but that didn't work for me.

LisaLeach
Meteoro

Hi @T_Willins 

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

Take Care

Lisa

MichaelLaRose
Bola de fuego

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

Etiquetas
Autores con mayor cantidad de soluciones