Apply a filter
In this topic
In Esri Maps for IBM Cognos, you can apply filters to layers in the map to present a focused view of your data. By limiting the visibility of features in a layer, patterns can more easily be revealed. For example, a filter might be applied to a layer showing retailer locations so that only the retailers with a yearly revenue of at least $15,000 are displayed on the map.
When configuring a map, the report author has the option of applying filters to specific layers. Report consumers can modify these filters or create their own to change the view of the map. Report authors also have the option of disabling the Filter layer tool in a report. For more information, see Configure map settings and tools.
You can also use the Filter layer tool to trigger interactive behaviors configured by the report author. Click Trigger interactions after applying your filter; the filtered features are selected, and configured interactive behaviors that are enabled for automatic interactions are triggered by the selection.
Modify or create a filter
If the report author has applied a filter to a layer, you see a filtered view of the data when the map is loaded. You can modify the filter expression to change this view. If the report author did not apply a filter, you can create a new filter expression to apply to the layer. Any filters you create or modify only apply to your view of the map and are not saved.
- In the Contents pane, click the Configure layer button beside the layer for which you want to modify or create a filter.
- Choose Filter layer.
This tool is only available if it was enabled by the report author.
- Modify or create a new filter expression.
Expressions use the general form of <Field_name> <Operator> <Value, Field, or Unique>.
- You can create one expression, multiple expressions (click Add another expression), or one or more sets of expressions (click Add a set). A set is a grouping of expressions, for example, Retailer_type = department_store and Revenue <= 10,000.
- If you have more than one expression, use AND or OR to display features in the layer that match all or any of your expressions. AND requires that all of the criteria you have specified must be true. OR means that any of your expressions must be true for the features to display.
- For the field part of the expression, choose the field you want to query against from the drop-down menu with fields.
- For the operator part of the expression, choose an operator from the drop-down menu with operators, such as =, <>, >=, or <.
- If you want to filter based on a specific value, choose Value and enter a value in the field. The input box varies depending on the field type.
- If you want to compare the value in one field to the value in another field, choose Field and choose the field for your expression from the drop-down menu.
- If you want to filter based on a specific value in the field you've chosen for your expression, choose Unique and choose a unique value from your field. Unique value filters require an ArcGIS 10.1 or later map service. The Unique option does not appear if you are creating a filter on an ArcGIS 10.0 or earlier service.
- To delete an expression or set in the filter, click the Delete button to the right of your expression or set.
- To add an expression to a set, click the Add an expression to this set button to the lower right of the set.
- When you are finished modifying or creating your filter expression, click Apply to apply the filter to the layer.
The map updates to display the new filtered view.
You can click Reset at any time to reset or remove the filter. If you modified the report author's filter expression, clicking Reset removes your changes and reverts to the original filter. If you created a new filter expression, clicking Reset removes the filter from the layer.
- Click the Close button to close the Filter tool.
Considerations for filters
- Do not add special characters to your values unless those special characters are part of the value. For example, City = "New York" doesn't find a feature named New York. In this example, use City = New York instead.
- If your field includes coded values, the Values list shows all coded values defined by the service for the field. This may include values that do not exist as features in the layer. The Unique list shows all the features in the layer (which may be a subset of the values in the service).
- The Unique option requires an ArcGIS 10.1 or later map service. The option does not appear if you are filtering an ArcGIS 10.0 or earlier map service.
- If you have multiple expressions, your results vary depending on how and whether you group them in sets. For example, if you create a filter where all of the following expressions must be true: Investment_class = Balanced Fund OR Investment_class = Mortgage Fund (this is a set) AND Client_sales is >= 30,000 (this is a single expression), the filter selects Balanced Fund investment branches and Mortgage Fund investment branches with client sales greater than or equal to $30,000.
If you instead create your filter where the following must be true: Investment_class = Balanced Fund AND Client_sales >= 30,000 (now this is your set) OR Investment_class = Mortgage Fund (this is a single expression), your filter selects Balanced Fund investment branches with client sales greater than or equal to $30,000 and all Mortgage Fund investment branches.
Trigger interactive behaviors
After applying a filter, you can easily trigger configured interactive behaviors.
The option to trigger configured interactions is only available if the Trigger interactions tool was enabled by the report author. For more information, see Configure map settings and tools.
- Apply the filter you want to the layer.
- Click Trigger interactions.
Features intersected by the filtered features are selected.
Only the features in layers for which on-selection interactive behaviors were configured are selected.
Based on the selection, configured interactive behaviors that are enabled for automatic interactions are triggered.