Skip to main content
This page provides practical SQL query examples for working with your Metronome data exports. Use these queries as starting points for your own analysis and reporting.
All examples use standard SQL syntax. Adjust date functions and syntax as needed for your specific data warehouse (Snowflake, BigQuery, Redshift, etc.).

Core Entities

Customers

Count all non-archived customers.
Tables: customer

Events

Track event ingestion volume over time.
Tables: events

Invoicing

Finalized Invoices

Calculate total invoice counts and amounts by month.
Tables: invoice
Break down monthly revenue by line item type.
Tables: invoice, line_item

Draft Invoices

Track draft invoice progression over time.
Tables: draft_invoice
Get the latest draft invoice totals grouped by contract.
Tables: draft_invoice

Invoice Breakdowns

Analyze line item metrics from the most recent draft breakdowns snapshot.
Tables: breakdowns_draft_invoices, breakdowns_draft_line_items
Get detailed draft line item breakdowns per customer and invoice.
Tables: breakdowns_draft_invoices, breakdowns_draft_line_items

Contracts

List all archived contracts.
Tables: contracts_contracts
Get the latest pricing overrides for a specific contract.
Tables: contracts_overrides
Replace <contract_id> with your actual contract ID.
Analyze rate card coverage by counting active entries.
Tables: contracts_rate_cards, contracts_rate_card_entries

Alerts

Get all active alerts configured to send webhooks.
Tables: alert
Analyze alert trigger frequency by day.
Tables: customer_alert_history, alert