Filtering your table provides a way to work with and focus on a subset of records. You can filter on different requirements, including the following:
- Show selected records
- Use a definition query
- Join matching records
- Filter by map time
- Filter by map range
- Filter by map extent (2D only)
Show selected records
To interact with selected records only, consider switching the table display to the Show selected records mode. In Show selected records mode, the table view will only list those records that have been selected in the table. You can always change your selection either by updating the currently selected features in the map corresponding to the open table, or by changing your selection in the table. The table will dynamically update to reflect the current selection set.
- Right-click a stand-alone table in the Contents pane and click Open .
- Alternately, right-click a feature layer in the Contents pane and click Attribute Table .
- At the bottom of the open table, click Show selected records .
To open a table directly in Show selected records mode, make sure some features are selected on the map. Right-click the layer in the Contents pane, point to Selection, and click Attribute Table Showing Selection , or click Table From Selection on the Data tab.
Use a definition query
Another way to filter the list of records in the table is to define a query expression. To create a definition query, do the following:
- Double-click a stand-alone table in the Contents pane to open the Table Properties dialog box.
- Alternatively, right-click a feature layer in the Contents pane and click Properties to open the Layer Properties dialog box.
- On the Properties dialog box, click the Definition Query page.
- Click Add Clause.
- Build an expression to define the subset of records and features you want to see.
- Click Add to add the expression. Click OK to close the dialog box.
See Introduction to query expressions for more information on how to build valid queries.
To remove a definition query, select the appropriate layer or stand-alone table in the Contents pane. On the Data tab, in the Definition Query group, change the drop-down list setting to <None>.
You can also start a definition query from the ribbon when a layer or stand-alone table is selected in the Contents pane. On the Data tab, in the Definition Query group, click the Dialog Box Launcher .
Join with only matching records
If you are joining tables, you can choose to display only the records that match. To do this, uncheck the Keep All Target Features check box in the Add Join tool.
If a record in the target table doesn't have a match in the join table, that record is removed from the result target table. If the target table is the attribute table of a layer, features that don't have data joined to them are not shown on the map.
If either the join table or the target table has a definition query applied to it, the result target table will honor the definition query.
Filter by map time
If your map contains time-aware layers, the table will filter records based on the current map time. As you step or play the time slider in the map view, only the records that fall within the current span will display in the table. By default, the filter is on when time is enabled in the map. To see all the records in the table, you can turn off Filter By Time at the bottom of the table view. You can also access filter options for the table under the Table tab, on the View tab, in the Filter group.
Filter by map range
If your map contains range-aware layers, the table will filter records based on the current map range. As you step or play the range slider in the map view, only the records that fall within the current span will display in the table. By default, the filter is on when range is enabled in the map. To see all the records in the table, you can turn off Filter By Range at the the bottom of the table view. You can also access filter options for the table under the Table tab, on the View tab, in the Filter group.
Time and range filters can be used together. If you have a map that is both time- and range-aware, the table will display records using both filters.
Filter by map extent
Filtering table records using the current map extent is only available in 2D views. To filter the table view to show only records that correspond to features in the visible geographic extent of the map, click Filter By Extent at the bottom of the table in the Filters list. Optionally, under the Table tab, on the View tab, in the Filter group, click Extent . As you pan and zoom the map to different extents, the rows in the table will update to match. The extent filter is not affected by layer visibility. The table will display records filtered appropriately by map extent even when layer visibility is turned off in the Contents pane or suppressed by a visibility range setting.
How to tell if your table has filtered data
The attribute table displays a list of filter indicator icons at the bottom of the table window for Filter By Range , Filter By Time , Filter By Extent , and Sorting . The icons are enabled automatically for the filter operation currently applied and otherwise unavailable. Click a filter icon to disable the filter status and display all the records in the table. You can also control Filter by Range, Time, or Extent under the Table tab, on the View tab, in the Filter group. To remove any sorting of records, right-click the column header and click Custom Sort . In the Custom Sort window, click Clear. Alternatively, use the keyboard shortcut Ctrl+Shift+A.
The image below shows the indicator icons for when the table is being filtered or sorted.