I want to remove duplicate points and I have this model.

I want to deselect all feature that have the same value of the OID. So I want to add value of the OID in the query of Select by Attribute. How do I incorporate this value in a SQL query ???

I try : "%Feature OID%" = "OID" (does not work) and a lot of other tests and nothing work

Someone have an idea?

  • It might not be why it's working, but why do you have percent signs (wildcards) around your field name? – Paul Aug 12 '13 at 19:42
  • help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/… With this recommandation i test to put % % on my variable to use it... but it's not working :( – user19717 Aug 12 '13 at 19:52
  • Oh, I completely forgot you are running within Model Builder.. forgot about inline variables. Sorry. – Paul Aug 12 '13 at 21:22

From what I understand, I would guess:

"OID" = %Feature OID%

Should work. As OID is the field you're trying to select from, double quoted as it's probably File GDB. And no quote for the %Feature OID% as OID is a numeric field.

| improve this answer | |
  • It's not working, When i try to get the value %Feature OID% in the SQL query, it not recognize him. Message error: Thre was an error with the expression. An invalid SQL statement was used – user19717 Aug 14 '13 at 13:23
  • If you verify the expression, it's gone a give you an error, but when run, it's gone a work. If it doesn't, please provide more information as the type of Workspace (shapefile, file GDB etc.). I have tested this and it works. – jeb Aug 14 '13 at 14:35

If you have an Advanced level license of ArcGIS for Desktop, you may try to go a different route to delete duplicate features based on a common attribute - the Delete Identical (Data Management) tool should do the trick.

arcpy.DeleteIdentical_management(in_dataset, "OID")
| improve this answer | |
  • I don't have common attribute for use this tool... When I want to use my numeric value %Feature OID% = "OID" it's for remove the oid which is based on the iteration and keep only the OID have the same location. My %Feature OID% is the number of iteration who correspond to my OID. I should call him otherwise – user19717 Aug 13 '13 at 13:05

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.