Calculate Field question

349
2
Jump to solution
08-23-2021 12:50 PM
Labels (1)
CZU_MatthewMosher
New Contributor

I'm new to using Modelbuilder and Arcade expressions and am trying to automate some daily processes. I'm using the Calculate Field geoprocessing tool within modelbuilder to calculate the percentage of total acreage within a fire perimeter for each polygon. Currently, I am updating the total fire acreage in the model each day manually. Is it possible to pull the total acreage field from a feature class in separate geodatabase within the map frame automatically with Python or Arcade? In this case, I would want to pull the data from a geodatabase named "Event Group - All Layers", from a feature class named "Event Polygon", and from a field named "Acres". 

I'm currently using the code below. The 725821.5 is what I would like to replace with a reference to the Event Polygon feature class.

$feature.Acres / 725821.5 * 100

If it's not possible to reference a separate geodatabase, it could also be done by dividing $feature.Acres by the sum of $feature.Acres, although I haven't been able to figure out how to do that. 

Thanks for any help!

Matthew

0 Kudos
1 Solution

Accepted Solutions
Tim_McGinnes
Occasional Contributor III

There is a solution for calculating the sum of the field automatically using Python in this post: Field calculator, sum of field. 

View solution in original post

2 Replies
Tim_McGinnes
Occasional Contributor III

There is a solution for calculating the sum of the field automatically using Python in this post: Field calculator, sum of field. 

CZU_MatthewMosher
New Contributor

That works, thanks tim!

0 Kudos