Hello guys,
Recently I have been facing an issue.
I have a shapefile. In its attribute table, I have a field (Float datatype).
When I use select by attribute for a floating point (e.g. <Field_Name = <Value>), no records are returned (snapshot attached).
This issue is occurring with the values with decimal values.
Adding those values into a text field is a workaround, but I want to understand what's causing this issue?
I am using ArcGIS 10.2 for Desktop Basic. Windows 7 Ent. SP1.
Any Help?
Thanks,
Jay
Solved! Go to Solution.
three things to check
1 are you typing the expression or selecting, the field name, the operand and then the value?
2 what about type Double, you said type Float which I never use so I can't confirm whether that is an issue
3 does the > or < operand work?
three things to check
1 are you typing the expression or selecting, the field name, the operand and then the value?
2 what about type Double, you said type Float which I never use so I can't confirm whether that is an issue
3 does the > or < operand work?
Hi Dan,
Thanks for replying.
1. Tried both typing the values as well as selecting the expression. Didn't work out.
2. Converting it to decimal has worked, but with certain workaround.
After creating a new Field (Double Datatype), I used Field Calculator, which gave me the following values
Selecting by Attribute with the value 3.1 doen't work here. So I used the expression by clicking the value in Get Unique Values.
After the selection is done, I used Field Calculator on the selected records, and just typed 3.1 on it.
Now, If I type the value 3.1 in the expression, the records get selected. However Clicking on Get Unique Value gives a value (See snapshot)
But, if I manually enter 3.1, it still works.
3. And > < works on the float value, but nor the = sign.
So thanks a lot. Don't know that's the issue with Float.
This is a floating point comparison issue. It is NOT POSSIBLE to test equivalence on some values. This is just the way binary computers (and IEEE floating-point representation) work.
Rather than testing any float value for equivalence, you must either test a range:
var > (value - threshold) AND var < (value + threshold)
or
abs(var - value) < threshold
or you must scale and convert to integer (which probably isn't an option in this particular use case).
- V