I'm totally struggling with a model build in ArcGIS 10.3.
Here’s what I’d like to do.
Take a table (analysis_table). Iterate over the rows in the table by a unique grouping identifier. From each row, use the values of two different fields, which are geoids, and select shapefiles from a separate database by those geoids. Create a new merged shapefile based on the two different shapefiles from the step immediately prior.
Here’s what happens:
I am able to parse out the value of two different variables within the row. This appears in the model as get field value (2) and get field value (3). These values are then fed into “select layer by attribute”, using a %value% expression.
Unfortunately though, select layer by attribute either has me make a new selection with each pass, or if I add to selection, it grows the selection continuously. In other words, rather than select a shapefile for each row in the iteration, it does one for each value that is passed from “I_analysis_table_OBJECTID”.
I want to merge the two shapefile outputs of “county_500k” (selected from my row iteration), save them out, then clear the selection for the next row pass, but I don’t know how or if that is possible.
You are right that I wasn't clear enough. I actually used different inline variable expressions for each Get Field Value, but I was getting sequentially more shapefiles added on with each row pass in the iterator. What I wanted was a new combined shapefile for each row pass of the iterator.
Today I took a different tact, and created sub-models to link each different attribute to each county, then bringing them back into the main model. I used a combination of "new selection" and "add to selection" in the select by attribute drop down options, which allowed each pass to start with a new selection, then add the sequential counties. You'll see that I added a third sub-model, but the syntax is essentially the same as the original problem I was trying to solve with two.
If it would be helpful to others, I can give more detail on the inline variable substitutions.