Usage metrics aggregate usage events into an overall measure of usage
Aggregation type | Requires aggregation property | Description | SQL equivalent |
---|---|---|---|
COUNT | no | Total number of events | COUNT(*) |
SUM | yes | Sum of a numeric property | SUM(properties[‘property_name’]) |
UNIQUE | yes | Count of unique values of a property | COUNT(DISTINCT properties[‘property_name’]) |
SUM
and UNIQUE
require you to specify an event property as the argument of the aggregation, enter the name of this property in the “Aggregation property” field.
When the billing engine runs, it calculates all usage metrics for each of your customers over the last billing period. This calculated value is then combined with a price to determine the charge that will appear on the invoice.
1: Numerical values (such as transaction amount, duration, size, etc) must conform with ISO 31-0.
method
,
you can filter your metric to events where method = card_payment
:
method
will let you display the usage for method = card_payment
and method = direct_debit
on separate lines on the invoice.
To learn more about customizing your invoice layout via grouping, reach out to the Sequence team.
Worked examples