Iterate Field Values - Using Value in Select Layer By Attribute

7594
25
Jump to solution
04-12-2013 07:21 AM
BJMalone
New Contributor
I am trying to build a model that iterates through the unique values of a field, then selects each of those values and calculates another field for that selection.  I'm having trouble passing the Value output from the iteration to the Select Layer by attribute tool.  For example each iteration would output a unique number, lets say 2104, then the Select Layer by Attribute tool would use 2104 as the selection criteria.  The model would iterate through all of the unique values calculating the field for each selected set.  I can't figure out how to get the Select Layer by attribute to use the output Value of the iteration.  Any help would be appreciated.  I am very new to model builder.
0 Kudos
25 Replies
BJMalone
New Contributor
When I run the model it doesn't seem to get past the first iteration.  It looks like Value = 1 instead of a the first value from the GridNumber field.
0 Kudos
MatthewPayne
Esri Contributor
Not sure what may be going on.  I have attached a model and shapefile that works correctly on my end.  See if you can successfully run it as well on your end.

Matt
0 Kudos
BJMalone
New Contributor
Matt,

I can't see a model inside of toolbox1.
0 Kudos
BJMalone
New Contributor
Matt, 

Can you please reattach the toolbox with the model?
0 Kudos
MatthewPayne
Esri Contributor
What version of ArcGIS for Desktop are you utilizing?

Matt
0 Kudos
BJMalone
New Contributor
I have tried on 10.0 and 10.1.
0 Kudos
MatthewPayne
Esri Contributor
Try this one.  Be sure to extract the contents from the zip folder first.

Matt
0 Kudos
BJMalone
New Contributor
I must be missing something.  When I add your toolbox, there doesn't seem to be anything in it.
0 Kudos
MatthewPayne
Esri Contributor
I had a few of my collegues attempt to open the model and they were successful.  I am not sure what may be going on.  Confirm that you are taking the exact same steps as entailed in the .swf video file below.

Matt
0 Kudos
BJMalone
New Contributor
Matt,

I cannot see the model inside the toolbox in version 10.0.  However, I moved to a 10.1 machine and can access it.  I ran the model exactly as you have it with the point3 file and it worked as expected.  I replaced your point3 file with my file and reran the model and it is currently running through all the iterations.  It may take it awhile to complete, but I will let you know the results when it's complete.  Thanks for you help on this.  I'm beginning to think something in my 10.0 installation was the problem.

BTW are you the same Matt Payne from WKU?
0 Kudos