This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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
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:
Stick a select tool before your formula tool and change the data type for [Sum_AUM_USD in MM] and [Sum_Funds raised last 10 years] from V_String to a numeric data type (Int 64 if the values are integers or Double if they have decimals)
You can temporarily convert a column to a certain data type for your expression to work by using the Tonumber function. Your expression will then be
[Final Firm Category]="F" && Tonumber([Sum_AUM_USD in MM])>=5 OR Tonumber([Sum_Funds raised last 10 years])>=5
Tonumber([Sum_AUM_USD in MM])>=4 OR Tonumber([Sum_Funds raised last 10 years])>=4 &&[Final Firm Category]="I"
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.