..

287
7
07-16-2020 09:24 AM
SofiaScott
New Contributor

.

0 Kudos
7 Replies
JoeBorgione
MVP Esteemed Contributor

Let's start with some nomenclature.  See the table below.  It has two columns: ID and flow.  There are are six rows or records in the table. Notice the values of each column for each row.

I'm not sure what using an iterator is going to gain for you, as I'm not sure exactly what your end product is intended to be.  You mention that for each ID you want the same flow value.  Look at the records where ID = 1 and notice that there are two records, one with a <null> value for flow the other with a value of 5.  If all you want is all the rows where ID = 1 to have a flow value of 5, just make a selection for those where ID = 1 and use the field calculator to up.date all those records such that flow = 5. (Or what ever value you want them to be)

As I recall, an iterator in model builder is a conditional statement, like  if some condition is true, do something or while some condition is true, do something else.

Are you looking to preserve the the non-null values in the flow column or are you looking to update the flow values based on the ID as I show above?

That should just about do it....
0 Kudos
SofiaScott
New Contributor

For example, if there are 3 columns with and ID of 1, one with a flow value of Null, another with a value of 4 and the last with a value of 2, I would want it to assign the one with a value of Null the average between the other two (2 & 4) to get a value of 3.

0 Kudos
JoeBorgione
MVP Esteemed Contributor

Hmmm.  That's a little more involved.  So you'd want the mean of all the non-null values, excluding the number of null values in the calculation of the mean?

You'll need to work with the Select by Attributes tool to narrow down each of the conditions you want, and then right click on the flow field and get the statistics for the values.  Of course, this assumes the flow field is of numeric type.

It may seem a little clunky at first, but it's going to be a lot easier than trying to do it in a model.

select by attributes in ArcGIS Pro

That should just about do it....
0 Kudos
SofiaScott
New Contributor

It needs to be in the model.

Thank you for your help!

0 Kudos
JoeBorgione
MVP Esteemed Contributor

So it must be that this task is repeated from time to time and that's why you need a model? 

That should just about do it....
0 Kudos
SofiaScott
New Contributor

I am just looking to update the flow values based on the ID as you show above. How would you do that with the field calculator?  

0 Kudos
JoeBorgione
MVP Esteemed Contributor

What are you using?  ArcMap or ArcGIS Pro?  Choose the appropriate help link.

That should just about do it....
0 Kudos