PROBLEM
In ArcGIS Online, users may encounter a limitation where the filter functionality does not support the use of attribute expressions directly as fields.
Suppose you have a map displaying data for counties in a region, with a layer showing population data for 2011 and 2021. You aim to filter the counties to only show those that have experienced a negative population change (decrease) during this period. However, you cannot achieve this using the Filter tool directly because it does not support creating interactive expressions for the filter criteria.
This is by design, the Filter tool in ArcGIS Map Viewer only supports filtering based on actual attribute fields in the dataset.
To work around this limitation, you can write an expression in the Styles pane in Map Viewer, in the Choose attributes section.
Here’s a step-by-step guide using the previous example:
The following expression is used to show only those features where the calculated percentage change in population is negative.
var procent = ($feature.population-2021-$feature.population-2011)*100/$feature.population-2011; if (procent < 0) {return procent}
The layer now contains only the geometries returned by the expression, symbolized in red in the example shown below. To display the counties with an increase in population in blue (the geometries that were not returned in the first result), a copy of the layer was created and another expression was used for Styles.
Article ID: 000033868
Get help from ArcGIS experts
Download the Esri Support App