Select to view content in your preferred language

Select by Attribute discrepency:

455
5
03-07-2019 07:41 AM
MatthewMoore3
New Contributor II

I have a table with five column that have integers in them ranging from 0 to 10.  When I use the Select Layer by Attribute tool and search for all records "is equal to" 0 I get a number.  When I then do a search with "is not equal to" 0 I get another number.  However the number of records I get for not equal to zero is different doing the search and subtracting the equal to zero from total.  The discrepancy is the same for all columns.  Example:  Total number of records 16,094 total number of records equat to 0 is 4,818.  So 16,094-4,818 = 12,086 When I do a Select by Attribute "not equal to zero" I get 11,276.  12,086-11,276=810.  This is true for five different columns with different data.  So, it appears that there are 810 records that are neither "not equal to 0" or "equal to 0".  This is not possile. Any ideas?

Total                                           16,904

=0                                                4,818

Difference (i.e. not equal to 0)   12,086

"NOT = 0"                                    11,276

Discrepency                                    810  This number is the same for all five columns

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

do you have any <null> 's in the column s?

also if any of the columns are floats/decimal you might be running into really really small numbers that would account for a number not being exacty 0 (ie 0.0000000000001)

MatthewMoore3
New Contributor II

Dan

I checked <null> and there are not any.  All the entries are integers.  The commonality is the discrepancy of 810 in all five columns.

Thanks, Matt

0 Kudos
DanPatterson_Retired
MVP Emeritus

what was your attribute query then?

Select Layer By Attribute—Data Management toolbox | ArcGIS Desktop 

and there are no duplicates in the data I presume

Also, I trust you are recording the X out of Y portion of the table dialog and not the last record number in the table (which isn't necessarily representative of the total number of records in a table)

MatthewMoore3
New Contributor II

Dan,

Thank you so much for your help.  This turned out to be a stupid mistake on my part.  I transposed two numbers on the total so of course the answer from the spreadsheet was wrong.  Sorry for wasting your time.  I really appreciate it.

Matt

DanPatterson_Retired
MVP Emeritus

I will mark it closed.  Glad you found it

0 Kudos