Hi!
I am trying to create a function in the formula tool that says: If Feild 1 is greater than 10 000, then leave as is, else make blank. My snytax looks like this: if [Book_Attr.GL Company] >= 10000 then [Book_Attr.GL Company] else "" endif .
I am receiving the error: Invalid type in operator >= . Is there something wrong with my snytax or another way to write a greater than function?
Thanks!
Solved! Go to Solution.
Hey @grsomer
Check [Book_Attr.GL Company] is coming through as a number and not a string
If that fails, "" is a string so Null() would be better
Null() worked much better, thanks so much!!
Hi @grsomer
The type mismatch error is probably caused by [Book_Attr.GL Company] being a string and your formula comparing it to a number. change your formula to this
if ToNumber([Book_Attr.GL Company]) >= 10000 then [Book_Attr.GL Company] else "" endif .
If you change the 10000 to a string like this
if [Book_Attr.GL Company] >= "10000" then [Book_Attr.GL Company] else "" endif .
Your error will disappear but you'll get cases where "2000" is greater than "10000" because the >= is using an alphabetical comparison
Dan
I am trying to make a formula where I have to apply Greater Than formula between two columns like [ABS]>[Right Amount], but it is showing error, How to do?