How to save values from iterator output to new table

429
1
07-08-2011 07:24 AM
KevinRamsey
New Contributor
I'm using a Model Builder iterator to select rows and then create summary data about those rows (using Summary Statistics). I want to add these statistics to a new table. I need to add a new row to this table for each iteration, then populate the fields of that row with the iterator outputs (iterator Value and a few values from the summary statistics output). I'm not sure how to do anything past creating the summary statistics. Any tips?

I see that this can be done in Python scripting, probably using InsertCursor in some way. But I'm very new to Python and would prefer to stay within Model Builder if possible. Is there a solution for me?

Thanks for any help you can provide!
0 Kudos
1 Reply
DaleHoneycutt
Occasional Contributor III
The Append or Merge tool ought to do the trick of appending the rows output from Summary Statistics.  As far as adding the iteration number, I would think that the rows would be added in iteration order -- that is, the object id of the row (in the merged table) would be the same as the iteration number (You'll need to experiment).  Otherwise, you could add a field to the output of Summary Statistics and use Calculate Field to calculate it to the iteration number.  You'd use variable substitution for this, as in '%n%'.  See A quick tour of using in-line variable substitution for more info
0 Kudos