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

217
3
10-21-2021 08:51 AM
MeghJones
New Contributor II

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 Esteemed Contributor

Check out the answer provided here by @XanderBakker 

Does it help?

can't wait to retire....
MeghJones
New Contributor II

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 Esteemed Contributor

So is my reply worth a Kudos?

can't wait to retire....
0 Kudos