Overriding Parent Filters
In your workspace, you can apply data filters at the metric, insight, and dashboard levels. Specified based on attributes and attribute values, these filters change the computed values displayed in your insights.
Filters are applied to the data based on an order of precedence, in which dashboard filters are given the highest priority, followed by insight filters and then filters within metric definitions. For more information, see Filter Expressions.
In your metric definitions, you can specify overrides of the filters that have been specified in higher-level (parent) objects in your workspace.
A parent filter is any data filter applied to a workspace object from one of its parent objects. A parent object can be considered any insight that contains the metric or another metric built on the metric.
- For example, if your insight filter is defined to be Channel = Twitter, then by default all metrics in the insight are computed for data that matches Channel = Twitter. Similarly, if the dashboard filter is set to Date = June 2, 2014, then all metrics in the insight calculated from data matching Date = June 2, 2014 and Channel = Twitter. However, other insights on the dashboard are only filtered by the date value.
- If there is a dashboard filter and an insight filter on two different attributes: data must match both filter conditions in order to appear in the insight. In the MAQL query for the insight, a logical AND is applied between the filters.
- If the dashboard filter and insight filter are on the same attribute: the dashboard filter overrides the insight filter.
Only positive filters are overridden. Any negative filters added (for example ISN’T) are not overwritten.
A metric’s parent filters can be specified in any insight or dashboard containing the metric or in any metric in which the original metric is nested.
These filters are applied to a metric’s data before the computations has been executed.
In some cases, however, you may want to override parent filters or to specify which of these filters to apply from within your metric definitions. These insight filter overrides can be an important method for maintaining control over the data that is displayed for a metric.
For example, suppose your Total_Employees metric should display a single, consistent value wherever it is used in the workspace. However, your data model may make it possible to filter this metric by attributes such as Region or Office_Location in metrics, insight filters, and dashboard filters. By adding the WITHOUT PARENT FILTER keyword to the metric definition, you ensure that the Total_Employees metric returns a consistent value no matter where and how it is used in the workspace.
Applying insight filter overrides to your metric definitions can be very important to ensure consistency in usage. However, you should avoid overusing these overrides, as they can make your metrics less flexible and create debugging issues.
This section contains the following topics: