community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

AND OR Statement

Atom

Trying to write this conditional statement, but getting error ..Malinformed IF statement ...

 

IIF(OR(&&( [Plant2]=[Row+1:Plant2],[Plant2]=[Row-1:Plant2],[Stock Without IT] <= [Row-1:Stock Without IT],[Stock Without IT] <[Row+1:Stock In Transit ]),&& ([Plant2]=[Row-1:Plant2],[Stock Without IT] <= [Row-1:Stock In Transit ]), &&([Plant2]=[Row+1:Plant2],[Stock In Transit ]<[Row+1:Stock In Transit ])),[Stock In Transit ],NULL())

Highlighted
Magnetar
Magnetar

Try this:

 

IIF((([Plant2]=[Row+1:Plant2] && [Plant2]=[Row-1:Plant2] && [Stock Without IT] <= [Row-1:Stock Without IT] && [Stock Without IT] < [Row+1:Stock In Transit ]) OR ([Plant2]=[Row-1:Plant2] && [Stock Without IT] <= [Row-1:Stock In Transit ]) OR ([Plant2]=[Row+1:Plant2] && [Stock In Transit ]<[Row+1:Stock In Transit ])),[Stock In Transit ],NULL())

 

Unlike the typical syntax used in Excel etc., the && (and) and OR statements need to be between clauses rather than preceding a list of clauses in parentheses. For example, (A = B && B > C) rather than AND(A=B,B>C)... same with OR statement, which would be (A=B OR B=C). Note that you can also use two pipe delimiters || to signify OR.

 

Hope that helps!

 

NJ

Atom

Thanks Nicole! That helped.

Labels