Select to view content in your preferred language

How to create a dynamic display summing filtered attributes from multiple fields

185
3
Jump to solution
Wednesday
Goldendelicious
Occasional Contributor

I have a long form data set where each feature represents someone seeking assistance with maternal health issues. Each feature has a date and multiple other attributes (around 20) associated with it. (ex: prefer English, prefer Spanish, seeking assistance with X,Y, or Z, referred by WIC). I have converted each attribute so its value is a 1 or 0 rather than text fields like yes/no. They are currently represented geographically as polygons in the form of "City,Zip". Table example attached.


I'm working in Enterprise 11.5.

I am trying to create a dynamic display in Experience Builder that allows the following:

-the user can select a date range and

-the user can select for any combination of attributes (or none) and the display will change dynamically to show a choropleth type display of City,Zip geometry that is the sum of the filtered attributes within the specified date range.

So for example, if I selected Jan2025-March2025 as my date and attributes where its value is > 0 for "prefer Spanish", seeking assistance with childcare, "seeking assistance with childproofing home", and "referred by WIC", I would get a map display of the summed value for every City,Zip polygon that meets this criteria. But I could then remove the filter for 'referred by WIC" and the sum would recalculate without that attribute. 

I am trying to avoid creating a field for every attribute combination for every City,Zip because that would be... many hundreds of fields. Unless there is a way to do this through automation?

Anyway, what are folks suggestions on the best way to accomplish this, or is it too overly complicated/impossible to get done?

I've been researching solutions involving a relate table with a field that is overwritten with a new sum value based on the filtered attributes and date, but I couldn't figure this out.


Any help is greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
ShengdiZhang
Esri Regular Contributor

Hi @Goldendelicious ,

Short answer: Unfortunately, there is currently no built-in way to display dynamically calculated statistics on a map.

A statistics table can be created easily by using the Chart widget and its chart output data. If a filter is applied to the original layer, the chart output data updates automatically, so the statistics remain synchronized with the filter.

However, there is currently no built-in way to display these dynamic statistics directly on a map. Even if such a layer were available, configuring its symbology based on dynamically generated statistics would be another challenge.

One possible approach is to use a joined layer view to display aggregated statistics on the map. However, the joined layer is based on precomputed data and does not respond to filters applied to the original layer at runtime.

Another option is to use a related table. With the help of message actions, both the original layer and the related table can be filtered simultaneously. However, it is not possible to configure the original layer's symbology from values in the related table. This limitation remains even when using Arcade, because the visualization profile does not support FeatureSetByRelationshipClass. As a result, the layer's symbology cannot reflect the dynamically updated statistics after the filter changes.

Regards,

Shengdi

View solution in original post

0 Kudos
3 Replies
ShengdiZhang
Esri Regular Contributor

Hi @Goldendelicious ,

Short answer: Unfortunately, there is currently no built-in way to display dynamically calculated statistics on a map.

A statistics table can be created easily by using the Chart widget and its chart output data. If a filter is applied to the original layer, the chart output data updates automatically, so the statistics remain synchronized with the filter.

However, there is currently no built-in way to display these dynamic statistics directly on a map. Even if such a layer were available, configuring its symbology based on dynamically generated statistics would be another challenge.

One possible approach is to use a joined layer view to display aggregated statistics on the map. However, the joined layer is based on precomputed data and does not respond to filters applied to the original layer at runtime.

Another option is to use a related table. With the help of message actions, both the original layer and the related table can be filtered simultaneously. However, it is not possible to configure the original layer's symbology from values in the related table. This limitation remains even when using Arcade, because the visualization profile does not support FeatureSetByRelationshipClass. As a result, the layer's symbology cannot reflect the dynamically updated statistics after the filter changes.

Regards,

Shengdi

0 Kudos
Goldendelicious
Occasional Contributor

Thanks, I was thinking this was the case. Could a custom widget be designed to do what I'm after, or is it just not possible at all? 

0 Kudos
QunSun
by Esri Contributor
Esri Contributor

Hi @Goldendelicious ,

If you are using a custom widget, I think you could give the following approach a try:

1. First, create a client-side FeatureLayer containing only two fields: cityzip and count. You can populate these cityzip values by running a distinct query against the original service, where count represents the filtered quantity for each cityzip, and the geometry comes from the corresponding cityzip polygon in the original service. Then, add this FeatureLayer to the map for statistical display purposes—let's temporarily call it the statistics display layer.

2. Create a renderer for the statistics display layer based on the count field. You can use either a UniqueValueRenderer or a ClassBreaksRenderer.

3. When filtering by different attributes, send a statistics request to the feature service to aggregate count by cityzip, passing your attribute filters in the where clause. This will return a result structured like { cityzip: count }. Then, use these statistical results to update the count values in the statistics display layer. Since the renderer was already applied to the layer in Step 2, updating the count field will automatically refresh the layer's symbols.