Calculate sum of attribute value
Hello,
Is it possible to return the sum of selected feature's attribute value?
In my workflow, the user selects an area on the map using geometry picker and that area is then used to query my feature layer. In the returned results of the query, I have a attribute field that I wish to sum all of the values and show a total (rather then a list of each value).
Thanks,
Valerie
-
There are probably several ways to do this... But what I would do is create an empty array. Then loop (For Each activity) through the records of the features returned. In the loop, add each attribute value of interest to the array, and then sum the total of the array after the loop.
0 -
Hey Ryan,
Thanks for your response. I actually had the same thought and I have a For Each activity that adds the attribute value to an array, where I hit a dead end is how to sum the attribute values from that array. Is there an activity that you would recommend to do that?
0 -
Hey Ryan,
I figured out how to do this, I ended using arcade script to sum the array.
Anyways, thanks for your help!
0
Please sign in to leave a comment.
Comments
3 comments