<aside>

Documentation Home

</aside>


<aside> đź“ś TABLE OF CONTENTS

Start Here

Connecting Your Database

Supported Databases

The Fluent Pilot Process

Metrics

Your Business Users

Security

</aside>

Last Updated: 16.10.24

Introduction to Metrics

In Fluent, measures (or metrics) represent aggregated calculations based on the data in your database. They are defined using properties such as name, field_type, type, and sql. You can also apply filters to measures, set cumulative calculations, and even configure non-additive dimensions for cases where simple aggregation is not applicable (e.g., MRR or inventory). Additional properties such as value_meanings, use_when, and dont_confuse_with help improve the usability of your model, guiding both the LLM and end users in how to best apply these metrics.

Through examples, we see how various types of measures, such as averages, distinct counts, and cumulative measures, can be constructed with appropriate SQL expressions and aggregation types. The rich set of properties ensures that your model remains both flexible and powerful.

What is a Metric?

In the simplest terms, a metric is a calculated measure that helps quantify a particular aspect of a dataset. Metrics are derived from the underlying data, such as summing values, calculating averages, counting occurrences, or finding rates (e.g., conversion rate, growth rate). For example:

•	Revenue: Total sales within a specific time period.
•	Customer Count: Number of distinct customers over a specific time range.
•	Crime Rate: Number of crimes per 1,000 residents in a given area.

Measures (or metrics) are aggregations performed inside a SQL group by statement. A simple one is sum(sales), which you could specify in your data model with type: sum and sql: ${TABLE}.sales. Measures can become highly complex, offering flexibility that leverages the full power of your SQL syntax.

Simple YAML Example

In Fluent, measures (or metrics) represent aggregated calculations based on the data in your database. They are defined using properties such as name, field_type, type, and sql. You can also apply filters to measures, set cumulative calculations, and even configure non-additive dimensions for cases where simple aggregation is not applicable (e.g., MRR or inventory). Additional properties such as value_meanings, use_when, and dont_confuse_with help improve the usability of your model, guiding both the LLM and end users in how to best apply these metrics.

Through examples, we see how various types of measures, such as averages, distinct counts, and cumulative measures, can be constructed with appropriate SQL expressions and aggregation types. The rich set of properties ensures that your model remains both flexible and powerful.


Fluent Data Modelling Overview

To understand data modelling in Fluent, there are a few key concepts to grasp. If you’ve worked with data models like LookML before, these concepts will be familiar, and you can proceed directly to model implementation.

Examples


Properties of a Measure (or Metric)


Metric Properties Explained

To understand data modelling in Fluent, there are a few key concepts to grasp. If you’ve worked with data models like LookML before, these concepts will be familiar, and you can proceed directly to model implementation.

Views


A view directly represents an underlying database table. Views contain:

Dimensions


Dimension Groups


Fields


Joins


Filters


Symmetric Aggregates


YAML Template

Best Practices for Defining Metrics

  1. Consistency: Ensure that the same metric definition is used across reports and dashboards. Fluent enables central metric definitions, so the entire organization refers to the same “Total Revenue” or “Customer Count” metrics.

  2. Clarity: Use descriptive metric names that clearly indicate what is being measured and how. A well-named metric reduces confusion, especially when sharing insights with non-technical stakeholders.

  3. Understand Your Data: Be mindful of the nuances in your data, such as missing values, duplicate entries, or outliers. These can affect the accuracy of metrics, and Fluent helps flag or adjust for such issues during the calculation.

  4. Time Sensitivity: Remember to specify time ranges when defining metrics, especially when working with time-sensitive data. Metrics like sales or customer counts can vary dramatically over time.

  5. Performance Considerations: Some metrics, particularly those involving large datasets or complex calculations, can be computationally intensive. Fluent optimizes SQL queries for efficiency, but understanding the scope of your metric will help you design faster and more reliable queries.

Summary

Understanding key Fluent concepts like views, dimensions, and measures, along with maintaining consistency in naming conventions, is crucial to creating a well-organised, understandable data model. By adhering to these guidelines, you can simplify the user experience and ensure the integrity of the data model across your organisation.