Skip to main content

Use cases

Advanced reporting

Create reports with multiple metrics.

Custom reporting

Build reports with custom metrics.

Features

All the common API features, plus:
Group the results by one or more dimensions.
  • Use dimensions in the query to specify the dimensions to group by
Order the results based on a sort direction.
  • Use orderByColumn to specify the column to order by
Provides built-in cursor-based pagination for navigating through large data sets.
  • Use first to specify the maximum number of records to return
  • The pageInfo object in the response provides pagination details
See our API pagination guide to learn more.

Example

Example 1: Simple metric report query

Get the total taco sales for the last 30 days, grouped by restaurant name and taco name, and count distinct orders.

Usage

Arguments

The fields for querying a Metric Report. A Metric Report is a table whose columns include dimensions and Metric values, calculated over a given time range.
TimeRangeInput
The time range for calculating the Metric Report.
String
The time zone to use. Dates and times are always returned in UTC, but setting the time zone influences relative time ranges and granularities.You can set this to “America/Los_Angeles”, “Europe/Berlin”, or any other value in the IANA time zone database. Defaults to “UTC”.
[MetricReportDimensionInput!]
required
One or many dimensions to group the Metric values by. Typically, dimensions in a report are what you want to compare and rank.
[MetricReportMetricInput!]
required
One or more Metrics to include in the Metric Report. These will be broken down by dimensions.
String
The Query Filters to apply when building the Metric Report, in the form of SQL. These can be used to filter out rows.
Int
The index of the column to order the Metric Report by. The index is 1-based and defaults to the first Metric column. In other words, by default, reports are ordered by the first Metric; however, you can order by the second Metric, third Metric, etc., by overriding the orderByColumn input. You can also order by dimensions this way.
Int
The number of rows to be returned when paging forward. It can be a number between 1 and 1,000.
String
The cursor to use when paging forward.
Int
The number of rows to be returned when paging forward. It can be a number between 1 and 1,000.
String
The cursor to use when paging backward.

Response

The Metric Report node object. This type represents a single row of a report.
[String]
required
An ordered array of display names for your dimensions and Metrics, as defined in the report input. Use this to display your table’s header.
[String]
required
An ordered array of columns. Each column contains the dimension and Metric values for a single row, as defined in the report input. Use this to display a single row within your table.