Hi
I'm having issues with an if statement and I know it is the highlighted lines. Can anyone please show me what I'm doing wrong?
Hey @JeffVTR, I actually wrote a blog post on common Formula tool errors which I believe ought to cover the issues here!
https://community.alteryx.com/t5/Engine-Works/Troubleshooting-Common-Formula-Expression-Errors/ba-p/1067959
In particular I’d check the fields you’re checking the numeric value for I.e. [Moving Code] are the correct (numeric) data type. Also, where you use ‘OR’, you need to define the field again i.e. [Field] = ‘A’ OR [Field] = ‘B’. Take a look at the section about AND/OR statements not returning the correct results as well because your current syntax will need bracketing too.
Hi @JeffVTR
The problem is here.
Where you have initially created OR correctly but on the remaining you have used 2 or 3.
Kindly change to [Moving code] = 2 or [Moving code] = 3.
Many thanks
Shanker V
@DataNath you nailed it in your blog. I searched high and low for something like that and could not find anything on OR being used in IF statements.
To summarise, I needed to replicate the text that @ShankerV pointed out and add parentheses to the statement.
You saved my computer monitor @DataNath!