Style feature layer of sampling data based on Count of samples at each station

645
1
Jump to solution
03-15-2022 12:12 PM
Labels (2)
DanielShaffer2
New Contributor III

Hi, Everybody!

I'm working in ArcGIS Online/Pro/ArcMap. I have 10 years of water sampling data from multiple sampling stations. Stations have between 2 and 50 sampling events of 3 different types (Bacteria, Macroinvertebrates, Chemistry).

I have a GDB with a feature layer of Sampling Station points and 3 related tables (Bacteria, Macro, Chemistry). I want to symbolize the Sampling Stations by size, based on the number of sampling events at each location. I would have three copies of the Sampling Station layer (Bacteria, Macro, Chemistry) to display this.

Though I see several examples of changing the style based on attributes with an Arcade Expression, none of them seem available to me. I cannot access feature sets, and cannot seem to access table records (or the overall related table) from the functions available in the Arcade expression builder associated with the Change Style dialog.

How can I count the records at each station from a related table and set my symbol sizes from that count? As shown in the attached image, I can "see" the related record count in the feature layer's attribute table. How do access those numbers in "()" and symbolize my layer based on that?

Thanks for any help!

0 Kudos
1 Solution

Accepted Solutions
DanielShaffer2
New Contributor III

OK so this post was helpful, in that it made me read the referenced documentation page again...and a little more closely. Thanks, @jcarlson for lending @GISPro1 a hand!

I had previously tried creating a 1:1 join between features and my related table and saving as a Hosted Feature Layer View. However, I somehow missed the part in the original documentation about calculating statistics, rather than choosing which record to save. For an earlier effort, calculating stats was irrelevant to me.

Once the "join_count" field was added to my resulting table, accessing it from the Arcade Expression Builder for the Change Style dialog was easy:

    var splCnt = $feature["join_count"]
    return splCnt

I hope that my different post title helps somebody else find this answer. As many times as I searched the Community, it is beyond me how I had not come across this post. I randomly searched the ArcGIS Online forum by the title of a 5yr-old question about a similar issue from the ArcGIS Pro forum and found my answer!

Cheers!

View solution in original post

0 Kudos
1 Reply
DanielShaffer2
New Contributor III

OK so this post was helpful, in that it made me read the referenced documentation page again...and a little more closely. Thanks, @jcarlson for lending @GISPro1 a hand!

I had previously tried creating a 1:1 join between features and my related table and saving as a Hosted Feature Layer View. However, I somehow missed the part in the original documentation about calculating statistics, rather than choosing which record to save. For an earlier effort, calculating stats was irrelevant to me.

Once the "join_count" field was added to my resulting table, accessing it from the Arcade Expression Builder for the Change Style dialog was easy:

    var splCnt = $feature["join_count"]
    return splCnt

I hope that my different post title helps somebody else find this answer. As many times as I searched the Community, it is beyond me how I had not come across this post. I randomly searched the ArcGIS Online forum by the title of a 5yr-old question about a similar issue from the ArcGIS Pro forum and found my answer!

Cheers!

0 Kudos