0

How to select a row in ModelBuilder if a number appears again in the column "MyName_C"?

enter image description here

For the selected features the column "Ausrichtung" should be added with 180.

I am working with ArcGIS Desktop 10.6.

1

You could use the tool select by attribute with this query :

[FIELD_NAME] In (SELECT [FIELD_NAME] FROM [TABLE_NAME] GROUP BY [FIELD_NAME] HAVING Count(*)>1 )

Replace FIELD_NAME and TABLE_NAME as necessary.

Warning: The procedure outlined is not available for data stored in file geodatabase or shapefile formats.

Documentation : https://support.esri.com/en/technical-article/000006708

You could then use the calculate field with the option to calculate only selected to add 180 to your "Ausrichtung" column.

This procedure should work as separate steep or with the tool linked in a model.


As Nora point out there is a python solution that should work on any storage type (but only from version 10.0 and up as python expression are not supported in earlier version)

this work by creating a new field (short or long integer) that will be filled by 0 for single occurrences and the first occurrence of multiple values, duplicates are filled with 1.

the code block to use is :

uniqueList = []
def isDuplicate(inValue):
  if inValue in uniqueList:
    return 1
  else:
    uniqueList.append(inValue)
    return 0

full procedure : https://support.esri.com/en/Technical-Article/000012758

  • Thank you for your answer, unfortunately I need to working in a file geodatabase or with shapefiles. The solution is here: support.esri.com/en/Technical-Article/000012758 Thanks for your answers! – nora Aug 27 at 7:49
  • @nora i'll update my answer with your comment so other could find a complete solution – J.R Aug 27 at 8:19

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.