Skip to main content

Getting Started with AQL

AQL (Analytics Query Language) is Holistics' powerful language for defining metrics, dimensions, and business logic in your semantic layer. It enables you to create reusable analytics components that adapt dynamically to any context.

What is AQL?

AQL is a declarative language designed specifically for analytics. Unlike SQL which focuses on data transformation, AQL focuses on business metrics and their relationships.

Key benefits:

  • Reusable metrics - Define once, use everywhere
  • Context-aware - Metrics adapt automatically to filters, grouping, and time periods
  • Composable - Build complex metrics from simpler ones
  • Business-friendly - Express logic in terms users understand

Quick Example

Here's a simple AQL metric that calculates revenue:

metric revenue {
label: 'Revenue'
type: 'number'
definition: @aql sum(order_items, order_items.quantity * products.price) ;;
}

This metric can be used in any report, automatically adapting to whatever dimensions, filters, or time periods users apply.

Learning Path

1. First Steps

2. For SQL Users

3. Deep Dive

Common Use Cases

AQL excels at:

  • Period comparisons - Year-over-year, month-over-month growth
  • Nested aggregations - Average order value, conversion rates
  • Cross-model calculations - Revenue per user, product adoption metrics
  • Time intelligence - Running totals, moving averages, cohort analysis

Need Help?

Enable AQL

If you signed up before April 19, 2024, you may need to enable AQL for your datasets.

Resources

Let us know what you think about this document :)