# Filter Variables

The filter grammar includes variables that are defined for views. You use these simply by including them in an expression that evaluates to a Boolean result, such as the following:

width > 1500 // This filter returns views with a width greater than 1500.

View-level variables can be one of the following:

- Generic, in which case they are available in all views.
- Tool-specific, in which case they are only available for specific tool types.

For example, the trained variable is available for any view, while the precision variable is only available for Red Analyze or Blue Locate tool views.

In addition to view-level variables, the grammar also supports tool-specific, axis-level variables that you can use to filter views based on the presence, absence, or values of individual markings, labels, and other view elements. You use axis variables by including them in square brackets, following the name of the axis.

For example, the Blue Locate tool has two axes: feature (for found features) and match (for matched models). If you want to filter views that contain specific features, you would include feature, followed by square brackets containing the axis filter:

feature[x > 10 and x < 900] // This filter returns views containing a feature with an x-position between 10 and 900.

In this case, feature is the axis, and x and y are the axis-level variables.

Note:

For the region and filter axis in the Blue Locate tool, append an exclamation mark ('!') to the axis name to match labels instead of features:

feature![x > 10 and x < 900] // This filter returns views containing a label with an x-position between 10 and 900.

View-level and axis-level variables can be combined in a single expression:

trained and feature[x > 10 and x < 900] // This filter returns trained views containing a feature with an x-position between 10 and 900.

You can also use a path-delimiter ('/') to refer to axis variables in an expression.

feature/x > 10 and feature/y < 900 // This filter returns trained views containing at least one feature with an x-position greater than 10, and at least one feature with a y-position less than 900.