Select to view content in your preferred language

Select by Attributes in Model Builder

25211
7
08-31-2011 04:39 AM
KathrinSchulte-Braucks
Emerging Contributor
Using ArcGIS 10 I am able to incorporate "Select by Attributes" directly into my model. I then want to process the selected features. "Select by Location" is working successful, but connecting it to the following tools (e.g. Dissolve/Eliminate,...) always gives this error message:

"Failed to execute, parameters are not valid. Error 000840. The value is not a feature layer."

The output shapefile is somehow a so-called "Table View/Raster Layer/Mosaic Layer", although the Input Layer of "Select by Attributes" is a Feature Layer.

How to deal with this? If I put "Make Feature Layer" or "Copy Features" between "Select by Attributes" and the following tool, I get the same error message (see above).

Thank you very much for any suggestions!

Katze01
7 Replies
ShitijMehta
Esri Regular Contributor
Check attached image:
Is this what you are doing?
Pls provide some more details.
You are working with 10 service pack 2?
0 Kudos
KathrinSchulte-Braucks
Emerging Contributor
"Select by Location" is working successful,


Oh, of course I meant "Select by Attributes".

Thanks for your detailled answer! 🙂

Yeah, input was a shapefile. SQL Expression seems to be alright. I will try out the version with using the sql expression directly in the "Make Feature Layer" tool and connecting the output with the next tool.

I can post a graphic of the extraction of the concerned part of my model tomorrow. Right now I can't check if SP2 is installed, will do that tomorrow.

Is "select layer by attributes"  not intended to be applied on feature classes/ shapefiles?
0 Kudos
ShitijMehta
Esri Regular Contributor
Select LAYER by Attribute = Feature Layer as input
0 Kudos
KathrinSchulte-Braucks
Emerging Contributor
Alright! Good to know...I suspected something like that, but was unsure since the "Select by Attributes"-Tool itself gave no error message , but just the following tools (the "Results"- Window always showed that "select by attributes" succeeded).
0 Kudos
KathrinSchulte-Braucks
Emerging Contributor
Keep on getting an error message (Input must be a featue class) at the point that the Make Feature Layer Output is connected to "Eliminate" (see attachment).

The helpfile says, that Eliminate needs a Feature Layer with a selection as input. I put the sql expression in the Make Feature Layer tool
0 Kudos
ShitijMehta
Esri Regular Contributor
Can you post an image showing the tools in the model that are upstream of the Eliminate tool?

Also try this:
Use Make Feature Layer tool to create a feature layer. Don't use any expression in this. Then use the Select Layer By Attribute tool to make a selection in the layer and connect the output of Select Layer By Attribute to the Eliminate tool. This should work.

The Eliminate tool works on a selected features from a feature class.
Make feature layer with an expression creates an output layer with only the features that honor the expression, whereas the Select Layer By Attribute tool  creates a output layer with all the features in it but with features selected based on the query.
0 Kudos
SerenaCain
New Contributor
I have the same problem trying to build a model.
When I run step by step in the model, it runs well.
When I create parameter and run the model from ArcToolbox, it gave me the error: ERROR 000840
The value is not a Raster Layer. ERROR 000840: The value is not a Mosaic Layer.
I have checked all the setting, and there is anything that indicates the Feature Class has to be Raster.
Attached are the error message and parameter properties of my model.
Please help!
Thank you!
Serena
0 Kudos