Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
Generally exclusion is easier to work with, especially if you only want to exclude <Null>. What is prompting the switch? –  Paul Jul 2 '13 at 17:08
    
I dont have any <Null> values, I want to exclude certain attributes. To continue down the exlusion route, how would I change the syntax to exclude multiple values (ie TCE, Tunnel)? –  kkaszas Jul 2 '13 at 17:32
    
Ahh, I see. I had assumed you were only excluding one value. I misunderstood the question. Does it work if you add the same field multiple times for different Null values? –  Paul Jul 2 '13 at 17:52
    
I haven't been able to get it to work with even one attribute yet. I've tried writing the following under "Null Value" : <TCE>, 'TCE', "TCE", NOT TCE. None of these have worked. I am not sure if the capability exists within this tool to even define what you want to be seen as null. Are you able to get it to work? –  kkaszas Jul 2 '13 at 18:19

2 Answers 2

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)
share|improve this answer

I figured out a solution that was simple with the model that I already had. In order to select which records of a field that I wanted to iterate in my tool, I just set a definition query on the feature class itself. This allowed for me to only include the records that I wanted to run through my tool. In the "Iterate Feature Selection" tool in ModelBuilder, I left the "Null Values" option blank since I didn't have any true null values.

share|improve this answer
    
I'm glad it worked out for you! –  Paul Jul 3 '13 at 2:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.