Skip to content
M↓ View as Markdown ↗

Dimensions

Dimensions are the attributes you slice, filter and group your data by. They answer "by what?" or "for which?", as in "Show me revenue by customer" or "Filter to active users only". They are typically columns in your database table that you want to:

  • Filter by ("Show me only premium customers")
  • Group by ("Break down sales by region")
  • Display as labels ("List customer names")

Add or edit a dimension

Availability

  • Who can do this: members with the Edit capability in the active Workspace.
  1. In Studio, open Models and select a model.
  2. Open the Dimensions tab.
  3. Select a dimension in the list to edit it, or click New dimension at the bottom of the list.
  4. Fill in the fields described below.
  5. Click Save dimension.

To delete a dimension, select it and click the Remove (trash) icon next to its name, then confirm Remove dimension?.

Each dimension name must be unique within its model. If you reuse a name, you see "This model already has a dimension with that name".

Dimension fields

Dimension name

A clear, descriptive identifier for this attribute.

Examples: created_at, is_active, customer_name, product_category

Description

Explain what this dimension means and when to group or filter by it. Be specific about what the values mean.

Example: "Type of customer account - either business (B2B) or consumer (B2C)"

Type

Select the kind of values the dimension holds:

  • String: Text values like names, categories, IDs
  • Number: Numeric values like age, capacity, count
  • Boolean: True/false flags
  • Timestamp: Dates with time (includes hour, minute, second)
  • Date: Calendar dates (year, month, day)
  • Enum: Fixed set of allowed values

Enum values

When AI Analyst drafts a model from a table or a SQL query for you, it reads the distinct values of each Enum column from your warehouse and stores them as that dimension's allowed values, which the AI Analyst can see when it queries the model. A column with more than 50 distinct values gets its regular type instead of Enum. The dimension editor in Studio doesn't show or edit this list of values.

Primary key

Select Primary key to mark this dimension as uniquely identifying a row of the model, for example an id or order_id column.

SQL expression

SQL that produces this dimension's value from the model's source columns. Usually this is just the column name (for example status), but you can write any scalar expression in your warehouse's SQL dialect (for example UPPER(region)).

  • The expression is stored and run as written, in the SQL dialect of the model's data connection.
  • A dimension expression can't aggregate. If it contains an aggregate function such as SUM or COUNT, AI Analyst won't save it; put that calculation in a measure instead.
  • The editor validates the expression against the warehouse as you type.

Sample values

As you edit the SQL expression, AI Analyst shows sample values from your data below the editor ("Loading sample values…" while they load), so you can check the dimension before saving it. If the warehouse rejects the expression, its error message appears under the editor and Save dimension stays disabled until the expression validates. If the check can't be completed, you see "Failed to load sample values".

Dates, timestamps and time grains

Date and Timestamp dimensions can be grouped by period in queries (for example DATE_TRUNC('month', created_at)). The dimension editor has no time grain setting. To control which time grains (day, week, month…) a KPI may be reported at, set Allowed time grains on the Metric. See Metrics.

Dimensions vs measures

Dimensions are what you filter or group by, with no aggregation. If you want to sum, count or average something, you need a measure.

Limiting which dimensions an AI Analyst can use

By default, an AI Analyst that can access a model can use all of its dimensions. When an AI Analyst's model access is set to Choose specific models, you can narrow which dimensions and measures of each model it may use. See Models in the AI Analyst configuration.