Connecting to databases other than Google Analytics requires an Enterprise plan. Contact Sales for details.

What are Measures?

Measures are aggregated computations performed on specific columns within your model. They are used to derive insightful metrics, often serving as the foundation for more complex analytical structures. Measures can range from simple sums or averages to intricate calculations utilizing various dimensions, conditions, and data transformations.

How to Define Measures

When defining a measure, you should be familiar with several key parameters:

Name

A unique identifier for the measure, distinct across all semantic models in your project.

Description

A human-readable explanation of the calculated measure.

Aggregator

Specifies the aggregation type to be applied (e.g., sum, average, max, etc.).

Expression (expr)

References an existing column or provides a SQL expression for a new/derived column.

How to create and edit a measure

In the Catalog section, select the table for which you want to configure a measure. Then, navigate to the Measures tab.

Specification for Measures

Measures are defined using the following structure:

measures:
  - name: [Measure Name]
    description: [Description]
    agg: [Aggregation Type]
    expr: [SQL Expression or Column Name]
    agg_params: [Aggregation Specific Properties]
    agg_time_dimension: [Time Dimension]
    non_additive_dimension: [Dimensions that shouldn't be aggregated]
    label: [Label for the measure]

For example, in a semantic model for transactions:

semantic_models:
  - name: transactions
    description: A record of all transactions. Multiple transactions are recorded per SKU for carts.
    model: {{ ref("fact_transactions") }}
  measures:
    - name: transaction_amount_usd
      description: Total USD value of transactions
      expr: transaction_amount_usd
      agg: sum
      label: Transaction Amount (USD)
    - name: average_transaction
      description: Average USD value of transactions per day
      expr: transaction_amount_usd
      agg: average
      label: Average Daily Transaction

Supported Aggregations

Findly supports a rich set of aggregation types to cater to diverse data analysis needs:

Basic aggregations provide elementary mathematical operations on data.

  • sum: Total of values.
  • min: Smallest value.
  • max: Largest value.
  • average: Mean of values.

When creating measures, ensure that the data types and SQL functions are compatible with your specific data platform’s capabilities, as these can vary.

Wrapping Up

Measures are pivotal for deriving insights from your data through metrics. By understanding and effectively utilizing measures, you can generate more valuable and accurate metrics for your analyses.