Skip to main content

Modeling your Data

Creating a Metric

Metrics in Sundial are time-based aggregations that represent quantitative measurements like revenue, users, or engagement. They allow you to track performance across different time periods and segments. Before creating a metric, ensure you have connected your data source to Sundial and created the series of transformations encoding the business logic, up to the final table that can be mapped.

  1. Navigate to the Glossary

    • In the sidebar, go to the Glossary
    • Click on "Metrics" to access the list of all metrics
    • Click the "+ New" button in the top right.
    • You'll see a form with the following required fields
  2. Define the Basic Properties

    • Name: Enter a unique, descriptive name for your metric (e.g., "Daily Active Users", "Monthly Recurring Revenue")
    • Description: Provide a clear explanation of what this metric measures
    • Table: Select the table containing the data for this metric
  3. Configure the Aggregation

    • Time Grain: Choose the time period for aggregation:
      • Daily: Aggregates data by day
      • Weekly: Aggregates data by week
      • Monthly: Aggregates data by month
    • Aggregation Type: Select how to compute the metric:
      • SUM: For cumulative values like revenue or counts
      • COUNT: For counting occurrences
      • COUNT(DISTINCT): For counting unique values (e.g., unique users)
      • AVG: For average values
      • MAX/MIN: For extreme values
  4. Select the Measure Column

    • Choose the specific column from your source table that contains the values to aggregate
    • For example, select revenue_amount for a revenue metric or user_id for a user count metric
  5. Configure Dimensions (optional)

    • Select columns that are dimensions to enable segmentation and filtering
    • Select which existing Dimension it should be mapped to or create a new dimension
    • Common examples dimensions include:
      • Geographic: country, region
      • Technical: platform, device_type
      • Business: product_category, subscription_tier
  6. Save and Chart

    • Click "Save" to create your metric.
    • Create a quick chart to test if the numbers make sense.
    • Check that the aggregations and filters work as expected

Read more about metrics in the reference

Creating a Dimension

  1. Navigate to the Glossary

    • In the sidebar, go to the Glossary
    • Click on "Dimensions" to access the list of all dimensions
    • Click the "+ New" button in the top right
    • You'll see a form with the required fields
  2. Define the Basic Properties

    • Name: Enter a unique, descriptive name for your dimension (e.g., "Country", "Product Category")
    • Description: Provide a clear explanation of what this dimension represents
  3. Save and Validate

    • Click "Save" to create your dimension
    • The dimension will be available for mapping new and existing Metrics from now on.

Read more about dimensions in the reference

Creating an Entity

  1. Navigate to the Glossary

    • In the sidebar, go to the Glossary
    • Click on "Entities" to access the list of all entities
    • Click the "+ New" button in the top right
    • You'll see a form with the required fields
  2. Define the Basic Properties

    • Name: Enter a unique, descriptive name for your entity (e.g., "User", "Order", "Subscriber")
    • Description: Provide a clear explanation of what this entity represents and its role in your data model
  3. Save and Validate

    • Click "Save" to create your entity
    • The entity will be available for reference in metrics and can be used to link metrics to this entity.

Read more about entities in the reference