2

I am working with the Shapefile consisting set of points. One of its field (let's call it X) contains numeric data, ranging from 0 to 1. In order to find out the average value of field X, I opened Attribute table, navigated to the field X and clicked with the right mouse on it. Showing me the list of options, the option Statistics is not active, meaning I cannot click on it.

It is a text field holding double. When I tried to perform some filtering using this attribute X, the operation looked like X >= '0.99' for example. But it worked, it indeed performed the operation correctly.

Has anyone ever faced this situation?

  • 2
    is it a text field that is holding integers? – ed.hank Jan 23 '16 at 17:31
  • 1
    @ed.hankins Yes, it is a text field holding double. When I tried to perform some filtering using this attribute X, the operation looked like X >= '0.99' for example. But it worked, it indeed performed the operation correctly. – MichalB Jan 23 '16 at 18:02
  • 5
    You cannot do math on a text field. You must first convert it to a numeric field. – Vince Jan 23 '16 at 18:27
3

you need to create a new field in your attribute table and call it [Z] and make it float type, then do a field calculate on it making the new field [Z] = int([X])

once you have done this, you can run the stats on the new float field [Z] and it will work.

you can never get stats on a field that is a string. you will always have to convert it to int or float etc... to be able to get stats

  • 1
    In this case, a double (or single) float field appears to be more appropriate. – Vince Jan 23 '16 at 21:33
  • yes float is definitely more appropriate here, I corrected my answer to reflect it. – ed.hank Jan 23 '16 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.