Merge all iteration output to single output in modelbuilder

17949
17
Jump to solution
04-22-2016 02:35 PM
AbdullahAnter
Occasional Contributor III

In the model builder, I have different result of features on every iteration inside same model.

How can I merge all result feature to single output feature class ??

Tags (2)
17 Replies
DarrenWiens2
MVP Honored Contributor

Did you collect the values with Collect Values?

0 Kudos
AbdullahAnter
Occasional Contributor III

no I didn't

but if I put collect value, will collect from first iteration to last iteration or last iteration only

and if the input are features, Is collect value tool output features  or not?

0 Kudos
curtvprice
MVP Esteemed Contributor

And did you uniquely name each output in the iterator by naming it something like "tmp%n%"? Otherwise the iterator will just overwrite on each iteration! (The examples in the help demonstrate this.)

AbdullahAnter
Occasional Contributor III

yes I did that I put %n% in the end, but I have last result only.

that is because merge tool run in every iteration, isn't that. but that is not that what I want.

I want to collect all iteration data in one merge, not many merge in every iteration

(one merge for all iteration) 

0 Kudos
AbdullahAnter
Occasional Contributor III

I made it.

the solution is replace merge tool with append tool.

it was on that link : Problems Integrating Sub-Model into Master Model

DanPatterson_Retired
MVP Emeritus

It would have been useful since most of use were under the assumption that you wanted to produce a new output rather than appending to an existing output.  Append adds to an existing output (which isn't a good idea for a variety of reasons) and Merge produces a new output, leaving the inputs to the model unaltered.

I hope you weren't producing a new output then appending to it, since that is a problem with collecting the results from iterator.

From the help...

To combine input datasets into a new output dataset, use the Merge tool.

I think Darren's suggestion is still the correct one, but we didn't get to see your model

0 Kudos
AbdullahAnter
Occasional Contributor III

No Dan, I want to make accumulative features from each iteration.

I tried Merge tool and Append, But Append tool  is the right.

thanks for help

0 Kudos
DanPatterson_Retired
MVP Emeritus

i guess it isn't clear what you are appending to then.  Obviously you are appending to one of the elements used as input into the iterator (thereby changing it), rather than collecting the results of the iterator to produce an output.  Seeing that part of the model would be interesting to see where that would be useful.

0 Kudos