Hi everyone, i've tried searching for a result for my problem but i couldn't find a solution that worked for me, probably because I'm new using Alteryx.
I'm trying to do a multiple IF formula to compare a lot of cells, but I'm having a problem that I can't quite understand from where it comes.
It's in two parts:
If I end my formula with ENDIF all the text in the box becomes black instead of the having the formula colors, like it stops registering the text as a formula and just reads it as text, and the error showing in Data Preview is "Invalid type in operator ==."
If I end my formula with END all the colors are as they should be (brownish for cells, pink for the AND, etc..) but i still get an error which says "Malformed If Statement"
I've tried looking at the data type values to check if they match but they all seem fine.
Thanks in advance to anyone who replies.
Solved! Go to Solution.
Hi @Stringer- ,
I think adding 'else' will resolve this error . You can share your formula if it is not resolved.
Hello,
An IF statement in the formula tool must contain an ELSE statement and terminate with ENDIF. This took me a while to get used to when all I wanted to do was a simple IF > THEN > ENDIF.
The "Invalid type in operator ==" can occur when you try to evaluate a value as the wrong type (using/omitting quotes).
Examples that would cause the error:
IF [MyNumericField] == "3" THEN
IF [MyNumericField] == "ABC" THEN
IF [MyTextField] == 2 THEN
IF [MyBooleanField] == "true" THEN
This was it, i had a problem with the data types.
Did you ever resolve this? I'm having a similar problem