Arcade expression to locate matching records and produce total numeric values based on another field

01-04-2022 01:46 PM
New Contributor III

Hello all,

I'm attempting to create an arcade expression to do the following:

  • Find all matching records based on a unique identifier (County ID)
  • Use the matched records to find associated and varied acreage values
  • Calculate a total for the associated and varied acreage values



Any insight will be greatly appreciated! Thank you.

0 Kudos
2 Replies
MVP Frequent Contributor
// load the feature set using an appropriate FeatureSetBy* function
// see FeatureSetByID and below:
var fs = FeatureSetBy*(...)

// filter the feature set by county ID
// your scrrenshot shows field aliases, not names, check that I guessed the right name
var county_id = $feature.CountyID
var fs_county = Filter(fs, "CountyID = @county_id")

// return the sum of field "Acres"
return Sum(fs_county, "Acres")

Have a great day!
0 Kudos
New Contributor III

This was a great help. Thank you Johannes!

0 Kudos