Order Error Rate
Order Error Rate: Percentage of orders with processing errors.
Formula
Order Error Rate = Orders with errors / Total orders × 100 Computable definition
The canonical formula in the GASP formula grammar. The MCP server compiles it to SQL over the datasets listed below.
count_distinct(field.order_id where in_period(field.order_completed_at) and field.has_error = true) / count_distinct(field.order_id where in_period(field.order_completed_at)) Unit: percent (the formula yields an unscaled ratio)
Data requirements
Grain: Per event · Frequency: Per transaction · Aggregation: event · Staged: no · Main source: Billing.
| Field | Dataset | Type |
|---|---|---|
has_error | order | boolean |
order_completed_at | order | timestamp |
order_id | order | string |
snapshot_date | order | date |
Example SQL (Postgres)
SELECT (CAST((SELECT COUNT(DISTINCT order_id) FROM order WHERE snapshot_date = :period_end AND ((order_completed_at >= :period_start AND order_completed_at < (:period_end + INTERVAL '1 day')) AND has_error = TRUE)) AS DOUBLE PRECISION) / NULLIF((SELECT COUNT(DISTINCT order_id) FROM order WHERE snapshot_date = :period_end AND (order_completed_at >= :period_start AND order_completed_at < (:period_end + INTERVAL '1 day'))), 0)) AS order_error_rate From an agent: with the GASP MCP server, call
lookup_metric({ "name": "Order Error Rate" }) or generate_query({ "metric": "Order Error Rate", "adapter": "<your adapter JSON>" }).
What It Tells You
Process quality and system reliability.