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

Conditional Statement with multiple conditions

alijalil
6 - Meteoroid

Hello Im trying to build a multi-conditional statement  as follows

 

If([Category]="medicine" and [CountNonNull_Birth_Country]= "5", then "Yes", else "No" endif . For some reason, I get malformed IF statement error at "5". Attached table snapshot below. Thanks in advance! 

 

alijalil_0-1668759374797.png

 

8 REPLIES 8
ShankerV
17 - Castor

@alijalil 

 

It is because the column CountNonNull_Birth_COuntry will be INT 

Hence when you do the check under "5" double quotes, it is for string.

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

@alijalil 

 

INT - I try to refer as Interger/Numeric

messi007
15 - Aurora
15 - Aurora

@alijalil,

 

Please try the formula below :

 

If ([Category]="medicine" and [CountNonNull_Birth_Country]= 5)  then "Yes" else "No" endif 

 

I think you forgot to close parenthesis and CountNonNull type is double that's way I deleted the quotation marks.

 

Hope this helps!

Regards

binuacs
21 - Polaris

@alijalil You need to update your IF Else Formula

 

binuacs_0-1668760030041.png

 

ShankerV
17 - Castor

@alijalil 

 

Please find the sample output for your issue

 

ShankerV_0-1668760168409.png

 

 

Many thanks

Shanker V

Raj
16 - Nebula

If([Category]="medicine" and [CountNonNull_Birth_Country]= 5  then "Yes", else "No" endif 

try this (insert a select tool to convert nonull to int16 if not)

 

Annotation 2022-11-18 140235.png

alijalil
6 - Meteoroid

@messi007 Thanks, this worked!

alijalil
6 - Meteoroid

Thank you all for the responses.

 

One more thing - do we know where we can get the sample solutions for the practical questions from the Core certification assessment?

Labels
Top Solution Authors