MetricReportMetricInput
The fields for specifying a Metric to include in a Metric Report.
fields
metric optional MetricInput
The Metric to query. You can query a pre-configured Metric by ID or name, or you can query an ad hoc Metric that you define inline.
metric.id optional ID
The ID of a pre-configured Metric.
metric.name optional String
The name of a pre-configured Metric.
metric.custom optional CustomMetricQueryInput
An ad hoc Custom Metric.
metric.count optional CountMetricQueryInput
An ad hoc Count Metric.
metric.sum optional SumMetricQueryInput
An ad hoc Sum Metric.
metric.average optional AverageMetricQueryInput
An ad hoc Average Metric.
metric.min optional MinMetricQueryInput
An ad hoc Min Metric.
metric.max optional MaxMetricQueryInput
An ad hoc Max Metric.
metric.countDistinct optional CountDistinctMetricQueryInput
An ad hoc Count Distinct Metric.
displayName optional String
The name to display in the
headers
array when displaying the report. This defaults to the Metric's unique name if unspecified.filters optional array of FilterInput
The Query Filters to apply when calculating the Metric.
The fields of a filter.
You can construct more complex filters using
and
andor
. For example, to construct a filter equivalent to(value > 0 AND value <= 100) OR status = "confirmed"
you could write
{ "column": "value", "operator": "GREATER_THAN", "value": "0", "and": [{ "column": "value", "operator": "LESS_THAN_OR_EQUAL_TO", "value": "0" }], "or": [{ "column": "status", "operator": "EQUALS", "value": "confirmed" }] }
Note that
and
takes precedence overor
.filters.column required String
The name of the column to filter on.
filters.operator required FilterOperator
The operation to perform when comparing the column and filter values.
The available Filter operators.
EQUALS
Selects values that are equal to the specified value.
NOT_EQUALS
Selects values that are not equal to the specified value.
GREATER_THAN
Selects values that are greater than the specified value.
GREATER_THAN_OR_EQUAL_TO
Selects values that are greater or equal to the specified value.
LESS_THAN
Selects values that are less than the specified value.
LESS_THAN_OR_EQUAL_TO
Selects values that are less or equal to the specified value.
IS_NULL
Selects values that are null. This operator does not accept a value.
IS_NOT_NULL
Selects values that are not null. This operator does not accept a value.
filters.value optional String
The value to compare the column to.
filters.and optional array of FilterInput
Additional filters to AND with this one. AND takes precedence over OR.
filters.or optional array of FilterInput
Additional filters to OR with this one. AND takes precedence over OR.
sort optional Sort
The sort order for the Metric. It can be ascending (
ASC
) or descending (DESC
) order. Defaults to descending (DESC
) order when not provided.The available sort orders.
ASC
Sort in ascending order.
DESC
Sort in descending order.