Measure and dimension behavior
Clarify the semantic rules that shape calculations, grouping, filtering, and relationships.
Behavior tells you how a measure or dimension should be interpreted in analysis. Read it before you choose a member, group results, or compare values across time.
Measure types
simple
Plain count, sum, avg, min, or max.
Group by any dimension and sum across any time range. Examples: orders.total_units, products.sku_count.
flow
Amount accumulated during a time window. January plus February equals Jan–Feb.
Always set timeDimensions with a dateRange in REST. Examples: orders.total_revenue, orders.returned_units.
stock
Level at a point in time.
Sum across entities such as brands or store regions. Do not sum across time. Pin time to a single point or narrow boundary. Check time_dimension, period_treatment (last, avg, first), and period_grain.
ratio
Numerator divided by denominator at the query grain.
Do not average a pre-computed ratio. The API recomputes it from parts. Check behavior.numerator and behavior.denominator. Example: orders.return_rate.
derived
Built from other measures, such as growth rates or shifted comparisons.
Check behavior.measure_refs for dependencies.
Dimension types
categorical
A standard analysis category.
Safe in dimensions[]. Examples: orders.store_region, products.brand.
identifier
A key for filtering and joining.
Do not group by it. Most identifiers are public: false and cannot appear in queries.
bucketing
A numeric range band, such as a price tier.
Group it like a categorical dimension.
ordinal
An ordered category, such as a size band or satisfaction score.
Group it like a categorical dimension. Alphabetic sorting may not match semantic order.
Reading behavior from metadata
behavior = col.get("behavior", {})
behavior_type = behavior.get("type")
# measures: simple | flow | stock | ratio | derived
# dimensions: categorical | identifier | bucketing | ordinalAuthor warnings
Columns and models can carry ai_context.caveats[]: short notes from the model author. Read them before using a measure.
Last updated
Was this helpful?