Alteryx Designer Desktop Discussions

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

AND OR Statement

Abp
5 - 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())

2 REPLIES 2
NicoleJohnson
ACE Emeritus
ACE Emeritus

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

Abp
5 - Atom

Thanks Nicole! That helped.

Labels