Alteryx Designer Desktop Discussions

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

Malformed if statement - not covered by existing items

MO21
Meteoroide

Hi all,

 

So I searched through existing discussion topics on this error and on nested ifs, but can not seem to find the difference between my syntax and that of other solutions.

 

It keeps giving me an error. Below is formula.

(Background, it should search column A (legal entity code) with specific code for all balances in column B (ending balance) that exceeds the amount stated and return a classification.

 

 

if ( [Legal entity code]="148" and [Sum_Sum_Ending Balance] >= 14410500) then "In-scope"

else if ([Legal entity code]=157 AND [Sum_Sum_Ending Balance] >= 9893250) then "In-scope"

else if ( [Legal entity code]=159 AND [Sum_Sum_Ending Balance] >= 9315750) then "In-scope"

else "Out of scope"

endif

 

Will appreciate any help!

2 RESPUESTAS 2
ponraj
Púlsar

Try this formula. It should work. I just removed double quote from 148, removed brackets for conditions and removed space between else if. 

 

if [Legal entity code]=148 and [Sum_Sum_Ending Balance] >= 14410500 then "In-scope"

elseif [Legal entity code]=157 AND [Sum_Sum_Ending Balance] >= 9893250 then "In-scope"

elseif [Legal entity code]=159 AND [Sum_Sum_Ending Balance] >= 9315750 then "In-scope"

else "Out of scope"

endif

MO21
Meteoroide

Great!  The brackets and quotes were fine, but the space between the else if was the problem! (Did not know about that one)

 

Thank you for the quick help!!

Etiquetas