Alteryx Designer Desktop Discussions

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

Conditional If and String functions together

Mancunian
8 - Asteroid

Hello

 

I have the following Module, I require the Fascia to be replaced with  the  "The Food Warehouse" when the fascia has the word "Warehouse" in it but has "Iceland" in the Company field.

7 REPLIES 7
BenMoss
ACE Emeritus
ACE Emeritus
if [Company] = "Iceland" 
then 
if contains([Fascia],"Warehouse")
then "The Food Warehouse"
else [Fascia] endif else [Fascia] endif

Should do the trick.

Kenda
16 - Nebula
16 - Nebula

Hey @Mancunian!

 

Try the following expression in your Formula tool:

iif([Company]='Iceland' && contains([Fascia],"Warehouse"),"The Food Warehouse",[Fascia])

Here we make use of the contains function. 

 

Hope this helps!

MarqueeCrew
20 - Arcturus
20 - Arcturus
IF 
   [Company] = "Iceland" AND
   Contains([Fascia],"Warehouse")
THEN
   Replace([Fascia],"Warehouse", 'The Food Warehouse')
ELSE
   [Fascia]
ENDIF

Based upon the text of you post, this is what I see a potential solution looking like.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
BenMoss
ACE Emeritus
ACE Emeritus

HA! Three solutions in less than a minute! Hopefully one works!

jasperlch
12 - Quasar

Hi, all you need to do it is swap [Fascia] and "Warehouse" in your findstring function

JoeS
Alteryx Alumni (Retired)

Alteryx Community at its best!

 

3 answers within 5 minutes of the question being posted, all slightly different responses as well.

Mancunian
8 - Asteroid

And possibly solutions from all over the world!

Labels
Top Solution Authors