How to select a row in ModelBuilder if a number appears again in the column "MyName_C"?
For the selected features the column "Ausrichtung" should be added with 180.
I am working with ArcGIS Desktop 10.6.
How to select a row in ModelBuilder if a number appears again in the column "MyName_C"?
For the selected features the column "Ausrichtung" should be added with 180.
I am working with ArcGIS Desktop 10.6.
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