Sum of numeric values within a field of an entire dataset??

681
3
10-21-2021 08:51 AM
MeghJones
New Contributor III

I am struggling to have dynamic calculations of the SUM function in ArcGIS Pro. 

How do I have the attribute rules go through and re-add (sum) the values of the entire dataset in one field as part of an equation? 

 

For example:

I created a 10-year plan in my dataset focused on minimizing risk in a work area. Each year's % risk depends on that years Overall Risk value (which is dependent on whether or not the risk was fixed by that time). This means that the overall risk value is constantly changing as problems are being fixed. The sum of that overall risk is what I need to use for the % risk field. 

 

Please help! Thanks in advance!

0 Kudos
3 Replies
JoeBorgione
MVP Emeritus

Check out the answer provided here by @XanderBakker 

Does it help?

That should just about do it....
MeghJones
New Contributor III

It got me most of the way there, thank you. 

Ended up using a code like this -- 

var risksum = FeatureSetByName($datastore, "HazAndCon")
var FeatureCount = Count(risksum);
return Sum(risksum, "OverallRisk2022");

0 Kudos
JoeBorgione
MVP Emeritus

So is my reply worth a Kudos?

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