Filter features

You can change the visibility of features in a layer so that not all the features are displayed when the layer is visible.

Features in a configurable layer can be filtered so that only those that apply to the map you are creating are visible. Filtering is done by creating a logical query based on attributes of the features—only the features with attributes that meet the query criteria will be visible in the map. For feature layers created and stored in a map, like the default Map Notes layers, you can control the visibility of each individual feature in the Layer Details view of the Layers panel.

To filter the features in a configurable layer

  1. In the Layers panel, click the arrow next to the layer for which you want to filter features. The Layer Details view of the panel appears.
  2. In the Layer Details view, under Filter, click Add.

    If there is already a filter applied to the layer, you see Remove and Configure buttons instead of Add; click Configure to change the existing filter.

    Filter Add button in Layer DetailsFilter Remove and Configure buttons in Layer Details

    NoteNote:

    If the layer is not configurable but still contains features, you see each feature in the layer listed in the Layer Details view, and you can turn each feature on and off individually. If the layer references a service that provides a map instead of individual features, no filtering or feature visibility changes are possible.

    The Query Definition dialog box opens, allowing you to define the criteria for a logical expression that indicates which features should be shown in the layer.

    The Query Definition dialog box for filtering features

  3. On the Query tab, click the Field drop-down arrow and choose the field you want to query against from the list.

    The fields in the layer are listed by name, and the data type of the field is also shown; the data type affects what kind of operator you can apply in the query.

  4. Click the Operator drop-down arrow and choose the logical operator for the query from the list.
    • For string fields, you can choose either Contains, Equal, or Not equal.
    • For numeric and date fields, you can choose either Equal, Greater than, Greater than or equal, Less than, Less than or equal, or Not equal.
    • For fields with domains, you can choose either Equal or Not equal.
  5. Enter the value you want to query for:
    • If you are querying for a specific value, enter this value in the Value box.

      The Query Definition dialog box with query criteria added

    • If you are querying against the values in another field, click Field, click the drop-down arrow, then choose the field you want to query against. You can choose a field when querying numeric and date fields.

      The Query tab showing the Field value option

    NoteNote:

    If you are querying a date field, you can use the Date Picker to choose a date.

    Learn more about querying a date field

    If you want to find out what the field values are, click the Data tab to see a subset of the features in the layer and their attributes.

  6. Click the Add button to add the criteria you have defined to the list of criteria at the bottom of the dialog box.
  7. Repeat the steps above to add other criteria to the query, if required.

    By default, if you add more than one criterion, the results of the query are those features that satisfy all criteria. You can choose instead to show features that satisfy either criterion by changing the logical operator button in the criteria list from And to Or.

    Setting the operator between criteria of a query

  8. If you want to group criteria in the query, select the criteria in the list and click the Group button at the bottom of the dialog box. Grouped criteria are shown surrounded by a box. You can also select a group of criteria and click Ungroup to remove the grouping and apply the criteria separately in the order listed.

    Grouping query criteriaUngrouping query criteria

  9. Click OK to close the dialog box.

The map is updated to show only the features meeting the criteria that you have specified.

When you add a service from content items in ArcGIS Online to your map, it may have feature symbology and other appearance properties already configured. You can change the configuration in the map, and you can also reset the configuration to that defined by the service item. If you are the owner of the service, you can also upload the new configuration from the map to your service item.

Learn more about uploading and resetting layer configurations

To show all features in a layer

If the features in a layer have a filter applied, you see Remove and Configure buttons in the Layer Details view, under Filter.

Click Remove to remove the filter query so that all the features in the layer are displayed.

Click Configure to change the existing filter.


3/11/2013