Credit Memo Rate
Credit Memo Rate: Percentage of invoices requiring credit memos.
Formula
Credit Memo Rate = Credit memos issued / Total invoices × 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.invoice_id where in_period(field.invoice_date) and field.credit_memo_count > 0) / count_distinct(field.invoice_id where in_period(field.invoice_date)) 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 |
|---|---|---|
credit_memo_count | invoice | integer |
invoice_date | invoice | date |
invoice_id | invoice | string |
snapshot_date | invoice | date |
Example SQL (Postgres)
SELECT (CAST((SELECT COUNT(DISTINCT invoice_id) FROM invoice WHERE snapshot_date = :period_end AND ((invoice_date >= :period_start AND invoice_date <= :period_end) AND credit_memo_count > 0)) AS DOUBLE PRECISION) / NULLIF((SELECT COUNT(DISTINCT invoice_id) FROM invoice WHERE snapshot_date = :period_end AND (invoice_date >= :period_start AND invoice_date <= :period_end)), 0)) AS credit_memo_rate From an agent: with the GASP MCP server, call
lookup_metric({ "name": "Credit Memo Rate" }) or generate_query({ "metric": "Credit Memo Rate", "adapter": "<your adapter JSON>" }).
What It Tells You
Billing errors and adjustments.