Hey All-
Apologize for the Arcade (and coding in general) noob question, but I am trying to figure out how to sum up the results of an attribute expression. Here's the scoop, the attribute expression is a polynomial expression that yields the stormwater benefits in dollars of a tree based on the trunk diameter in an expression popup field called StormwaterBenefits:
var SB = (0.0921*(pow($feature.DBH,2)))+(1.5627*$feature.DBH)-3.2441
No big deal, right? But what I want to do is know the sum total of all trees in the population of around 10,000 trees. Seems like I should be able to just do something simple like the following:
var SumSB = Sum($layer, 'StormwaterBenefits')
return '$'+text (SumSB, '#,###.##')
But Arcade won't accept the attribute expression result name as a valid field name as input to another expression. I feel like I am missing something REALLY obvious here. I have a few workarounds in mind, but I am really bent on figuring this out. Again, very little coding experience, so please speak slowly and use small words!
Thanks!