[GIS] How to iterate through only select attributes of a single field using ModelBuilder in ArcMap 10.1

arcgis-10.1modelbuilderselect-by-attribute

The feature class that I am iterating with ModelBuilder is a polygon FC called "Alignment" in my model. My current solution to iterating through only certain attributes of a single field does not seem to be working. My initial thought when creating this model was that I would use "Iterate Feature Selection" to choose the field that I wanted to iterate and then use the "Null Value" option to specify the attributes in the field that I wanted to skip. This might still work with a syntactic correction but I do not like that this current model is based on exclusion rather than inclusion, below is a screen shot of how I have the tool set up.

enter image description here

I would prefer to have more of an inclusion set up (specify which attributes I do want included) rather than an exclusion set up (specify which attributes I dont want included). Does anyone know how I can alter my model to accomplish this?

enter image description here

Thanks,
kkaszas

Best Answer

You'll probably want to use Make Feature Layer, upon which you can use SQL to restrict the features selected. Select Layer by Attributes is another tool which you might find useful if you want to remove certain records.

Select layer by Attributes can't be run on a feature class, so there actually is no need to use it (if you can write an advanced SQL query to do everything you want) as you would need to use Make Feature Layer first on the input.

Edit: The SQL statement for either would be something like below, where x,y,z are values you want to include (if you wanted exclusion, just put NOT after the field name). You can then use Copy Features and set that as input for iterate feature selection.

"DESCRIPTN" IN (x,y,z)
Related Question