ChartDataAdhocMetricSchema
Aggregation operator.Only required for simple expression types.
Possible values: [AVG, COUNT, COUNT_DISTINCT, MAX, MIN, SUM]
column object
The name of the target column
mycolType of target column
BIGINTSimple or SQL metric
Possible values: [SIMPLE, SQL]
SQLWhen false, the label will be automatically generated based on the aggregate expression. When true, a custom label has to be specified.
trueIndicates if the filter has been added by a filter component as opposed to being a part of the original query.
Label for the metric. Is automatically generated unlesshasCustomLabel is true, in which case label must be defined.
Weighted observationsUnique identifier. Can be any string value, as long as all metrics have a unique identifier. If undefined, a random namewill be generated.
metric_aec60732-fac0-4b17-b736-93f1a5c93e30The metric as defined by a SQL aggregate expression. Only required for SQL expression type.
SUM(weight * observations) / SUM(weight)Optional time grain for temporal filters
PT1M{
"aggregate": "AVG",
"column": {
"column_name": "mycol",
"type": "BIGINT"
},
"expressionType": "SQL",
"hasCustomLabel": true,
"isExtra": true,
"label": "Weighted observations",
"optionName": "metric_aec60732-fac0-4b17-b736-93f1a5c93e30",
"sqlExpression": "SUM(weight * observations) / SUM(weight)",
"timeGrain": "PT1M"
}