filters Properties

Use the filters property to add a filter to a step query. Although you can create filters for query steps in the user interface, you have to manually define filters for static steps in the dashboard JSON.

The syntax for a filter in the step definition varies based on whether the step is in compact or SAQL form. This section describes the filter syntax for compact-form steps, including a description and example of every operator. For information about the filters for SAQL-form steps, see the Analytics SAQL Developer Guide.

Filters defined in compact-form steps have the following syntax.

For example, the following filter shows only records where Sales is between 1 and 100,000 and Customer_Segment is either Consumer or Corporate.

Filters defined in compact-form steps have the following syntax.

For example, the following filter shows only records with a “Customer” account type.

To compare against multiple values, include the values in an array, like this.

To specify an absolute date value for a date filter, specify the value in epoch format, where the value is the number of milliseconds since January 1, 1970 midnight UTC (1970-01-01 00:00:00). The following example shows dataset rows with a close date on or before January 1, 2016.

You can use different operators in a filter. The supported operators depend on the field type. If you don’t specify the operator, Analytics applies the == operator.

OperatorDescriptionCompact-Form 2.0 ExampleCompact-Form 1.0 Example 
inValue of dataset field equals one of the specified values. Applies to dimensions only.["Dimension",["Value1","Value2"],"in"]["Dimension",["Value1","Value2"],"in"] 
not inValue of dataset field is not in the specified list of values. Applies to dimensions only.["Dimension",["Value1","Value2"],"not in"]["Dimension",["Value1","Value2"],"not in"] 
matchesValue of dataset field contains the specified value. This operator is not case-sensitive. Applies to dimensions only.["Dimension",["Val"],"matches"]["Dimension",["Val"],"matches"] 
is nullValue of dataset field is null. Applies to measures, dimensions and absolute dates in Compact form 2.0 and to measures only in Compact form 1.0.["Measure",[],"isnull"]["Measure",[[]],"isnull"] 
is not nullValue of dataset field is not null. Applies to measures, dimensions and absolute dates in Compact form 2.0 and to measures only in Compact form 1.0.["Measure",[],"isnotnull"]["Measure",[[]],"isnotnull"] 
==Value of dataset field equals the specified value. Applies to measures only.["Measure",[1],"=="]["Measure",[[1]],"=="] 
!=Value of dataset field does not equal the specified value. Applies to measures only.["Measure",[1],"!="]["Measure",[[1]],"!="] 
<Value of dataset field is less than the specified value. Applies to measures only.["Measure",[10],"<"]["Measure",[[10]],"<"] 
>Value of dataset field is greater than the specified value. Applies to measures only.["Measure",[1],">"]["Measure",[[1]],">"] 
<=Value of dataset field is less than or equal to the specified value. Applies to measures only in Compact form 2.0 and to measures and absolute dates only in Compact form 1.0.["Measure",[10],"<="]
  • ["Measure",[[10]],"<="]
  • ["Date",[[1229040000000]],"<="]
 
>=Value of dataset field is greater than or equal to the specified value. Applies to measures only in Compact form 2.0 and to measures and absolute dates only in Compact form 1.0.["Measure",[1],">="]
  • ["Measure",[[1]],">="]
  • ["Date",[[-374457600000]],">="]
 
>=<= or between with measures and dates in Compact form 1.0Value of dataset field is between the specified values, inclusive. For relative dates, you can specify the following time periods: “year”, “quarter”, “month”, “week”, and “day”. Applies to measures only in Compact form 2.0 and measures and dates only in Compact form 1.0. You can also use these operators with measures in Compact form 2.0 and measures and dates in Compact form 1.0:
  • >=< (Greater than or equal to one value, but less than another)
  • ><= (Greater than one value, but less than or equal to another)
  • >< (Between two values, exclusive)
["Measure",[1,10],">=<="]
  • ["Measure",[[1,10]],">=<="]
  • ["Date",[[-374457600000,1229040000000]],">=<="]
  • ["Date",[[["month",-1],["month",1]]],">=<="]
  • ["Close Date", [[null,1451606400000]],"<="]]
 
between with dates in Compact form 2.0Value of dataset field is between the specified values, inclusive. For relative dates, you can specify the following time periods: “year”, “quarter”, “month”, “week”, and “day”.
  • ["Date",[null, 1388448000000], "between"]
  • ["Date",[1388448000000, null], "between"]
  • ["Date",[["year", -1], ["year", 1]], "between"]
  

To view a complete example with a binding syntax, see the Bind the Initial Filter Selection documentation.