Alteryx Designer Desktop Discussions

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

Multi-Condition IF THEN ELSE statement

jlrouquette
7 - Meteor

There are many discussions about if statements but I'm struggling to find one in the format I'm looking for help with.

 

if [FIELD] < 6,000 THEN "A"

if [FIELD] is >= 6,000 and < 9,000 THEN "B"

if [FIELD" is >= 9,000 THEN "C"

 

I was able to manage 2 parts of the statement but I can't get the syntax right with the 3rd element without getting the "Malformed If Statement" warning. 

 

I appreciate any help!

 

-Luke 

17 REPLIES 17
prstructure
5 - Atom

Hi there 🙂

 

I was reading your post since I'm struggling to create a simple statement formula. I have followed the steps but still does not work, could you please help me here?

 

The formula is:

 

IF [Pricebook: Part Type] = "Service Contract Labor" THEN [Calculation Number]+" Service Contract Labor/Option"
ELSEIF IF [Pricebook: Part Type] = "Service Contract Option" THEN [Calculation Number]+" Service Contract Labor/Option"
ELSEIF IF [Pricebook: Part Type] = "Monitoring Service" THEN [Calculation Number]+" Monitoring Service"
ELSE ""

ENDIF 

 

Thanks in advance

CiaranA
10 - Fireball

IF [Pricebook: Part Type] = "Service Contract Labor" THEN [Calculation Number]+" Service Contract Labor/Option"
ELSEIF IF [Pricebook: Part Type] = "Service Contract Option" THEN [Calculation Number]+" Service Contract Labor/Option"
ELSEIF IF [Pricebook: Part Type] = "Monitoring Service" THEN [Calculation Number]+" Monitoring Service"
ELSE ""

ENDIF

 

You don't need ELSEIF IF, it should be just ELSEIF 

prstructure
5 - Atom

Oh that's 100% correct, I didn't realize about that, thanks a lot for the catch 🙂

prstructure
5 - Atom

I have another step where I'm stuck with, basically I want to highlight with 0 and 1 whether the value has appeared before or not. The formula that I did in excel is 

 

=(COUNTIFS($A$2:A14,A15)>=1)+0

 

So if the value has appeared before the result will be 0, otherwise 1

 

Any advice to get the same result ??

 

Thanks a lot 

CiaranA
10 - Fireball

Could you use a join tool and then write a formula to create the 1's and Zero's? depending on whether they joined to the list or not?

prstructure
5 - Atom

Thanks 

aiza_nievera
5 - Atom

IF [PBLOS Comment Aged] >3 THEN "P1"
ELSEIF [PBLOS Comment Aged] =2 THEN "P2"
ELSEIF [PBLOS Comment Aged] =1 THEN "P3"
ELSE "Pend" ENDIF

 

i am getting error - Error: Formula (15): Parse Error at char(108): Invalid type in operator ==. (Expression #1)

 

appreciate the help

Sreevidya7
5 - Atom

You can try this:

IF [Alternative BOM Text]= "SHIP & ENTER SUB" THEN "SES"
ELSEIF [Alternative BOM Text]= "SUB ONLY" THEN "SON"
ELSEIF [Alternative BOM Text]= "SHIP ONLY" THEN "SHO"
ELSE "ERROR"

ENDIF

Labels