Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice.
Actively maintained. Last release 2 weeks ago, commits in 18 of the last 26 weeks. A safe choice.
pip install metricflow
Build and maintain all of your metric logic in code.
Welcome to MetricFlow
See our latest updates in the Metricflow Changelog!
MetricFlow is a semantic layer that simplifies defining and managing metrics. It compiles these metric definitions into clear, reusable SQL, ensuring consistent and accurate results when analyzing data by relevant attributes (dimensions).
The name “MetricFlow” reflects its approach: metric requests are compiled into a dataflow-based query plan, which is then optimized and translated into engine-specific SQL.
MetricFlow provides a set of abstractions that help you construct complicated logic and dynamically generate queries to handle:
- Multi-hop joins between fact and dimension sources
- Complex metric types such as ratio, expression, and cumulative
- Metric aggregation to different time granularities
- And so much more
To get up and running with your own metrics, you should rely on MetricFlow’s documentation.