Select to view content in your preferred language

Populating a field with a single value from a cell in your table.

383
2
12-18-2019 02:26 PM
EricArscott
New Contributor

Hi there,

I have been trying to build a model that takes a maximum value from 1 field and inputs that value in a new field for every row. I have successfully extracted the max value from my "GRIDCODE" field and have joined this summary statistic back to the feature class as a new field titled "MAX_GRIDC" using "FID" 0 as the common class. However, this creates a field where only "FID" 0 has the "MAX_GRIDC" value and all other rows result in a value of 0. See photo below. 

I want to populate the rest of the "MAX_GRIDC" field with the value in cell 1 of its field, in this example, 365. Is there an easy way to do this? 

Thanks for your help!

0 Kudos
2 Replies
by Anonymous User
Not applicable

Hi Eric,

You will have to use the iterators in model builder to calculate the field for each row of the table.

They should be hidden away in the toolbar/ribbon.

In Pro they are located in ModelBuilder(in the toolbar) -> Insert (in the ribbon) -> Iterators (hexagonal icon)

Hope this helps,

Michael

curtvprice
MVP Esteemed Contributor

Eric,

You have MAX_GRIDCODE in a one-row table (output of Summary Statistics I am guessing) and you want to populate it for the all rows in another table with this value, correct?

Instead of doing a join, extract the value out to a model variable using the Get Field Value tool and use the resulting variable in an expression in the Calculate Field tool to populate that field for the entire table.

0 Kudos