Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

IF and AND statement formulae

Bryth
8 - Asteroid

Hello team, I am quite new to Alteryx and still learning. I need to write a formulae, using IF and AND function. this is what I have written. I have a filed called match( created this field with a formulae. I want to update another field called Team with either FMR or SOCA if the match field is "N" I used the IF and AND combination to write the formulae but I get this error all the time. what am I doing wrong with this. thank you in advance. 

 

IF [match]="N" AND [Team]= "FMR" THEN "SOCA" EndIF

4 REPLIES 4
ShankerV
17 - Castor

Hi @Bryth 

 

The ELSE is missing.

 

Syntax is:

IF condition

THEN

ELSE

ENDIF 

 

Many thanks

Shanker V

BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

You need an ELSE criteria aswell @Bryth .. see picture below

BS_THE_ANALYST_0-1675432604247.png

 

All the best,
BS

LinkedIN

Bulien
Emmanuel_G
13 - Pulsar

Hi @Bryth 

 

As @BS_THE_ANALYST  and @ShankerV  said, the else statement is missing in your statement and it is mandatory.

 

If you don't want to write it explicitly in all your if statements, you can use IIF function according to this syntax : IIF(logical_test,value true,value fase) as in excel.

 

In your case, the result is IIF([match]="N" AND [Team]= "FMR","SOCA",Null()) endif

Bryth
8 - Asteroid

Thank you guy's. i appreciate it a lot. it worked. 

Labels