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.
SOLVED

IF Logic with multiple Conditions

czjames87
8 - Asteroid

I am trying to create some logic that uses an iif statement with multiple conditions. Below is what I am currently using. However, it doesn't appear to work when I check the Power BI platform. Any advice would be greatly appreciated. 

 

I tried using uppercase(destination_city) to fix the case issue but it didn't work. I then used a data cleansing tool as well and it still won't fix the case. Any ideas on how to correct the case would be greatly appreciated as well. I don't know if that is causing the logic to fail. 

 

The Logic i am using 

 

iif([destination_city] = "Alburtis" || "HASLET" || "Rialto" , "DC Transfer", "Non DC Transfer")

 

The result i am getting in Power BI is this. I am getting duplicates and incorrect results 

 

czjames87_0-1605122485956.png

 

4 REPLIES 4
Raj_Singh1
9 - Comet

can you please share dataset in excel and also workflow if possible

Hi @czjames87 

 

I have attached 3 ways to write if in Alteryx. Hope this helps. Cheers!

 

christine_assaad_0-1605123439976.png

 

estherb47
15 - Aurora
15 - Aurora

Hi @czjames87 

I'd standardize the case in the field, just to ensure that they can find a match. I'm assuming that you're using Data 
Cleansing to remove any extra spaces or non-text characters.


You could try: IIF([destination_city] In ("Alburtis" ,"HASLET" ,"Rialto") , "DC Transfer", "Non DC Transfer")

 

Or a much longer way:

 

IF Contains([destination_city], "Alburtis") OR Contains([destination_city], "HASLET") OR Contains([destination_city], "Rialto") THEN "DC Transfer"
ELSE "Non DC Transfer"

ENDIF

 

Let me know if either work for you.

 

Cheers!

Esther

 

Let me know if that works

 

Cheers!

Esther

czjames87
8 - Asteroid

the last one worked like a charm. thank you so much for your help. 

Labels
Top Solution Authors