The first Select Layer By Attributes clears the selectionI have a simple model that selects layer by attribute of the feature class with the parameters of start year and end year set up as doubles and then use an expression in the select layer by attribute as: datesample_1 >= %Start Year% AND datesample_1 <= %End Year%. It then uses copy feature to make an output feature class. When I run the model individually it works fine, but when I run it as a batch even though I'm giving it different parameters, when it runs it uses the first parameters I entered over and over so my output features are all the same.

  • 1
    I think you are encountering gis.stackexchange.com/questions/36891/… and recommend that you try to put together a test something like in this answer and submit it to Esri support.
    – PolyGeo
    Mar 24, 2015 at 21:51
  • @PolyGeo Thanks I will have to look into learning about using iterators to figure this out.
    – brentL
    Mar 25, 2015 at 21:22

1 Answer 1


Have you considered putting your parameters in a table or list? Then you could insert an iterator into the model and iterate through the years. As for format of the table, DBF would probably work best, but CSV's still play well with Arc and are far easier to edit, so it's a question of preference.

On a side note, the parameters as you have described them can have instances of overlap if the dates aren't set properly. Let's say the two date ranges you wanted were 1991-95 and 1995-2000, the date ranges would be 1990<=DATE1<=1995 and 1995<=DATE2<=2000. This would result in all the data from 1995 being counted in both ranges. There are ways to work around this by setting the start date values properly (in this example it would be setting the start date of the range for DATE2 to 1996), but it might be a lot easier to change one of the <='s to a <.

As for your problem with the batch execution of the model, if it's working by selecting from layers you may need to add a step of clearing your selection at the very end of your model, after the results from your current run have been output. It's one of the selection types in the Select Layer By Attributes tool. That way the next run of the tool will be starting from scratch, layer-wise.

Read up on the link @PolyGeo posted, and the links in that thread. Apparently when a tool is executed in batch mode it runs the processes in parallel, rather than sequentially. For sequential execution you either want a ModelBuilder iterator, or a python script.

  • Thanks I should of mentioned that the final result is a point feature for each of the conditions I set with the start and ending year parameters. I don't know if by using an iterator I could do that, I am new to using model builder. I do have a select layer by attributes tool that clears the selection but it is at the very beginning of my model. If I could figure out how to post a picture of my model I would do that.
    – brentL
    Mar 25, 2015 at 19:43
  • If you have a layer as one of the parameters clearing the selection at the start of the model might not fix it. Apart from that, from what you've described, your model should work. But, then, this is ArcGIS. Mar 25, 2015 at 20:32

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.