Iterating selection of multiple features to create a merged output

3441
4
11-10-2017 01:10 PM
deleted-user-hwcOLD4Ux5CR
New Contributor II

Hey all, I've been using ModelBuilder for a while now, but I've recently been stumped by something that I'm fairly confident can be done.

I have a very large dataset containing point data that has been broken into monthly segments for the sake of saving processing and for management purposes. I want to be able to run a select by attribute on all of these feature classes to grab all data containing a certain value (ex. DistributorCode is equal to '123'). From here I would like to Merge these selections into a single feature class that I can then use for my analyses. 

I know Iterators are going to be the key to making this work, but so far I've had no luck building out a model that works. I know that working with a complete year's worth of data would be the easiest solution, but that option is not currently on the table for me so I'm trying to work with these monthly data.

Any help would be greatly appreciated!

0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus

Before any suggestions.... Have you gone through the documentation examples on

Examples of using iterators in Modelbuilder....

(there is an equivalent help topic for ArcMap, but you didn't indicate what software you were using... or I didn't see it)

0 Kudos
deleted-user-hwcOLD4Ux5CR
New Contributor II

Hi Dan,

I'm working with ArcGIS Pro - sorry for not clarifying in my initial post. I had read the documentation before posting, but I realized after going down the rabbit hole of Abdullah's comment below that I needed to integrate a model within a model to get close to the solution (info here: Integrating a model within a model—Help | ArcGIS for Desktop). 

My model is basically complete at this point. I've now run into an unexpected issue in that while the field aliases are the same for each month of data, the field name's were entered differently in each dataset making my select tool error out when trying to iterate for each dataset. This has now become a data issue so I'll have to work that out unless there is a way for to instruct the selection query to disregard field names and select based on the alias only. So far this doesn't seem possible..

0 Kudos
NinaRihn
Occasional Contributor III

I would iterate add a feature class iterator, and for each FC it hits, run the Select tool, saving the output as %Name%_Output, then merge all of the %Name%_Outputs

AbdullahAnter
Occasional Contributor III

Could you read tthe following Link , I think you will find the answer.

https://community.esri.com/thread/176035 

0 Kudos