Dimensions
A dimension is a categorical attribute in Sundial's semantic layer that maps to a column in a table. Dimensions are used to segment, filter, and group metrics to understand patterns across different categories.
Definition
A dimension consists of:
- Name: A unique identifier for the dimension (e.g.,
country,platform,device_type) - Source Column: The specific column in a table/view containing the dimension values
- Source Table: The table/view containing the dimension column, which is also mapped to metrics
- Values: The set of possible categorical values for this dimension
- Description: Documentation explaining the dimension's meaning and intended use
Examples
Common dimension columns that can be mapped to metrics include:
- Geographic: country_code, region_name, city_name
- Technical: platform_type, device_name, browser_version
- User: user_type, subscription_tier
- Business: product_category, marketing_source
Usage in Analysis
As part of Sundial's semantic layer, dimensions enable you to:
- Group metrics by categories (e.g., analyze revenue by country)
- Filter metrics for specific segments (e.g., active users where platform = 'iOS')
- Compare metrics across segments (e.g., conversion rate by device_type)
- Track changes in dimensional attributes over time (using changing entity dimensions)
Best Practices
When defining dimensions in your semantic model:
- Use clear, descriptive names that reflect the column name
- Document the meaning and valid values
- Ensure column values are standardized and clean
- Choose the appropriate dimension type based on whether the column values change over time
- Maintain consistency in dimension definitions across tables and metrics
- Map dimensions to actual columns in your tables that are also used by metrics