Skip to main content
Specifies fields that must be present whenever the measure is used in a query. Useful for measures that should never aggregate across a dimension (e.g. an amount that must be grouped or filtered by currency). When a measure with required_fields is added to a query, the required fields will be automatically added to the query. Required fields must be selected, pivoted, or filtered to a single value with exact equality filter or the query will error. See Filter requirements for more information. If any required fields are missing, the query will error.

Syntax

Properties

object[]
The name of the measure.

Filter requirements

Only exact single-value equality filters satisfy the required field constraint. The filter must pin the field to one specific value — this is treated as equivalent to grouping by that field. Only string and numeric equality filters are supported (e.g., currency = 'USD' or level = 5). Filters that do not satisfy the requirement:
  • Multi-value filters (e.g., currency IN ('USD', 'EUR'))
  • Negated filters (e.g., currency != 'USD')
  • Range filters (e.g., amount > 100)
Drill queries satisfy required field constraints because drills carry equality filters on the drilled dimensions.

Examples

Foreign exchange amount requiring currency