Hello all, new to arcade and while I have some experience working with related tables, I can not for the life of me figure out how to count the records by individual fields.
I have a series of numeric fields in a solid waste survey that I would like to count by response. Fields are numeric with 1 = yes and 0 = no (0). I'd like to count and display each fields totals in popup.
Field name example would be
etc...
Thanks in advance!
You can use Sum() for that.
// get the related table
var related = FeatureSetBy*(...)
// build the popup lines
var popup_lines = [
"Bulky Waste Items: " + Sum(related, "BWCnt"),
"Recyclables: " + Sum(related, "RecCnt"),
]
// conacatenate and return
return Concatenate(popup_lines, TextFormatting.NewLine)