We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula Tool

kiwipops
6 - Meteoroid

I currently have several formula tools, all with the same column being looked up, but the text lookup is different in each formula. However, each formula seems to cancel out the one prior. This is what I'm using, but x5+ & with different variables in the place of "X."

 

The idea is if column A contains word x, word y, word z, or word a, it will populate "yes" in the column I've selected (otherwise null).

 

EX:

if contains([column A],'.x') then 'yes'
else null()
endif

 

if contains([column A],'.y') then 'yes'
else null()
endif


So the second one with the "y" lookup ends up cancelling out x. I must be doing something wrong; the whole reason I broke out with different formula tools is if I push the "+" sign below the first formula within the Formula tool to add another, it was doing the same thing with cancelling out the prior formula. Is there only 1 formula that could put ~5 different variables (x, y, z) into one Formula tool?

I hope that makes sense--still a bit of a newbie! 🙂

3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @kiwipops 

 

You could either use a bunch of Contains functions in the same expression..

or REGEX

 

Formula expression

IF 

REGEX_Match([column A], ".*(x|y|z|a).*") then "yes"

ELSE null() endif 

 

Cheers,

kiwipops
6 - Meteoroid
That's perfect, thank you! This community is my favorite already. 🙂
kiwipops
6 - Meteoroid

This is PERFECT, thank you! I hadn't used RegEx before but sounds like I need to get aquainted.

 

This community is my favorite already! 🙂

Labels
Top Solution Authors