What is AMQL?
AMQL is the analytical language powering Holistics 4.0.
What is AMQL?
AMQL (Analytics Modeling and Querying Language) is the analytics-as-code language that powers Holistics' expressive semantic layer. Using AMQL, analysts define analytics logic in code (metrics, models, datasets, dashboards) and query that logic with composable, metric-centric expressions.
AMQL is two inter-connected components:
- AML (Analytics Modeling Language): a declarative language for defining data semantic models, business metrics, datasets, dashboards, and relationships. AML is to analytics what Terraform is to infrastructure: a typed, reviewable, version-controllable description of what you want.
- AQL (Analytics Query Language): a query language that operates on the semantic model defined in AML. AQL elevates metrics to first-class composable objects, so logic like period comparisons, cohort retention, ratios across grains, and nested aggregations stays inside the metric layer instead of leaking into SQL workarounds.
Together, AML and AQL are why Holistics' semantic layer is expressive enough for AI to reason from. Instead of generating SQL against raw schema, Holistics AI generates AQL against the governed semantic layer, using the same composable definitions humans already trust. See Why Holistics AI is reliable for the full mechanism.
AMQL is designed for data engineers, data analysts, analytics engineers, or anyone who works with analytics logic and wants better reusability, composability, governance, and development productivity than existing tools provide.
Metric-centric Thinking
AMQL follows “metrics-centric thinking” paradigm. AMQL allows users to query data at a higher abstraction level, closer to how business users operate. This makes AMQL more accessible to non-technical users compared to SQL.
A query in AMQL revolves around metrics and dimensions. These metrics and dimensions are defined beforehand by analytics team.
Check out Metrics-centric Thinking for a more detailed writeup.
Why we built AMQL?
- AML vs YAML: why we didn't use YAML configs (the route taken by dbt, Cube, MetricFlow, LookML 1.0).
- AQL vs SQL: why SQL strings can't be a metrics layer.
We strongly believe in the vision of analytics as-code as the future of BI and analytics. However, in our opinion, there is not an adequate existing analytics-as-code language.
Firstly, we believe there is a need for a declarative language to define semantic model, similar to how Ansible and Terraform revolutionized the way infrastructure is defined in code. When we look at existing declarative languages, there are languages like XML, JSON or YAML but each of them has their own limitations. The most suitable language is LookML but it is proprietary and only works with Looker.
Secondly, we also believe there is a need for a new query language that can leverage the semantic model defined in the first language, built to be concise, expressive while also suitable for adhoc analysis. We believe SQL is too low level as a language and solution like adding templating language (like dbt’s Jinja use) on top is just a band-aid.
Thus, in order to realize this vision, we created AMQL to be a complete analytics-as-code language.
Installation
AMQL is currently only available in Holistics Cloud. Support for self-hosted installation will come in future versions.