
Supergrain’s metrics framework enables data analysts to create source-of-truth, reusable definitions while maintaining the expressiveness and flexibility of SQL.
Learn about our metrics frameworkmetrics:
- metric: revenue
sql: ${TABLE}.amount
type: sum
dimensions:
- dimension: order_date
sql: ${TABLE}.order_date
type: time

GET orders.revenue BY MONTH(orders.order_date)
SELECT DATE_TRUNC(‘MONTH’, t1.order_date) AS month,
SUM(t1.amount) AS revenue
FROM raw_payments t1
LEFT JOIN raw_orders t2 ON t1.order_id = t2.id
WHERE t1.payment_method != 'discount_code'
GROUP BY 1
Supergrain Query Language (SGQL) is a SQL-like language that enables teams to answer business questions without worrying about joins, aggregations, or data model quirks.
Learn about querying metrics
Supergrain ships with an interactive CLI and sandbox environment for rapidly developing and testing metrics, enabling data teams to work more efficiently.
Learn about our development workflow
curl -s --request GET --url URL --header 'Authorization:
Bearer TOKEN --data ' {
"query": {
"sgql": "GET revenue BY MONTH(orders.order_date)"
}
}

Build simple workflows and self-service analytical applications on the Supergrain platform. Metrics served via our Open API are reliable, consistent, and interoperable by design.
Learn about our Open API