TypeDescriptionExample
CountCounts the number of records that match the filters.

For Time Series queries, it will count the values for each time granularity.
Order count
Count DistinctCounts the number of distinct values in the specified column for every record that matches the filters.

For Time Series queries, it will count the distinct values for each time granularity.
Unique customers
MaxSelects the maximum value of the specified column for every record that matches the filters.

For Time Series queries, it will select the maximum value for each time granularity.
Maximum order size in dollars
MinSelects the minimum value of the specified column for every record that matches the filters.

For Time Series queries, it will select the minimum value for each time granularity.
Minimum order size in dollars
AverageAverages the values of the specified column for every record that matches the filters.

For Time Series queries, it will average the values for each time granularity.
Average revenue per order
CustomApplies a SQL expression to the values of the specified columns for every record that matches the filters.

For Time Series queries, it will apply the custom expression to the values for each time granularity.
Total price defined as: SUM(unit_price) * SUM(quantity)

Examples

Count

...
metric: {
  count: {
    dataPool: {
      name: "TacoSoft Demo Data"
    }
  }
}
...

Count Distinct

...
metric: {
  countDistinct: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    dimension: {
      columnName: "order_id"
    }
  }
}
...

Max

...
metric: {
  max: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...

Min

...
metric: {
  min: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...

Average

...
metric: {
  average: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...

Custom

...
metric: {
  custom: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    expression: "SUM(unit_price) * SUM(quantity)"
  }
}
...