Skip to main content
This parameter inherits configuration from a dimension defined in another view. Use it to centralize reusable field definitions — such as colors, formatting, or labels — in a template view, then apply them to dimensions in any view that needs them. When a dimension extends another, attributes are inherited from the source. Attributes defined on the extending dimension override the inherited values.
Pair this parameter with a template view to keep reusable field configurations in a single, centralized location.

Syntax

<dimension_name>:
  extends: [ <view_name>.<dimension_name> ]

Properties

dimension_name
object
The name of the dimension inheriting configuration. Dimension names must:
  • Be unique within the view
  • Start with a letter
  • Contain only alphanumeric characters and underscores

Example

The following example defines a reusable status dimension in a template view, then applies it to dimensions in other views. First, create the color configuration. In this example, we’re using a template view to centralize our definitions:
color_templates.view
template: true

dimensions:
  status:
    colors:
      conditions:
        - condition:
            is: Complete
          color: rgba(0, 255, 0, 0.3)
        - condition:
            is: Cancelled
          color: rgba(255, 0, 0, 0.3)
Then, extend the template dimension in any view that has a status dimension:
orders.view
dimensions:
  status:
    extends: [ color_templates.status ]
    sql: status
The status dimension in orders inherits the colors configuration from color_templates.status, while keeping its own sql definition. Updating the template view propagates the change to all dimensions that extend it.