Hey all,
I got an issue on this function as the IF function keep popping out invalid ">=" Operator function. The error occurs right after the Bolded formula as the rest of the code is not recognized to completed the IF function
Anyone knows why would it happen?
IF
[Final Firm Category]="F" && [Sum_AUM_USD in MM]>=5 OR [Sum_Funds raised last 10 years]>=5
THEN "E"
ELSEIF
[Sum_AUM_USD in MM]>=4 OR [Sum_Funds raised last 10 years]>=4 &&[Final Firm Category]="I"
THEN "E"
ELSE "C"
ENDIF
Solved! Go to Solution.
Hi @cbabel14 ,
Can you please provide us with a screenshot of the data types for the fields used in the expression?
So
[Final Firm Category], [Sum_AUM_USD in MM] and [Sum_Funds raised last 10 years]
Thanks,
Angelos
Hey AngelosPachis
Sum_AUM_USD in MM | V_WSTRING |
Final Firm Category | V_WSTRING |
Sum_Funds raised last 10 years | V_WSTRING |
Hey @cbabel14 ,
Thanks for sharing that extra detail.
As you can see for your own, all those fields are of String data types, but >= is a numerical operator. So Alteryx cannot find which values are greater than 5 because it treats all of them as text (for example you can tell if fg<=ed)
There are two ways you can solve this:
IF
[Final Firm Category]="F" && Tonumber([Sum_AUM_USD in MM])>=5 OR Tonumber([Sum_Funds raised last 10 years])>=5
THEN "E"
ELSEIF
Tonumber([Sum_AUM_USD in MM])>=4 OR Tonumber([Sum_Funds raised last 10 years])>=4 &&[Final Firm Category]="I"
THEN "E"
ELSE "C"
ENDIF
It's best practice to have the correct data type for your columns, so if it contains data that you want to use for certain expression that column should be of numeric data type, so I suggest you go down route no.1, but either would work.
Let me know if that worked for you.
Cheers,
Angelos
Hey Angelos,
It works! thanks alot! I will bear that in mind when it comes to choosing to correct data types
Cheers!