Payment Method Distribution
Payment Method Distribution: Breakdown of payments by method.
Formula
Method share = Invoiced amount in period paid by the method / Invoiced amount in period with a known method Computable definition
The canonical formula in the GASP formula grammar. The MCP server compiles it to SQL over the datasets listed below.
sum(field.invoice_amount where in_period(field.invoice_date)) / total(sum(field.invoice_amount where in_period(field.invoice_date) and field.payment_method is not null)) Unit: percent (the formula yields an unscaled ratio)
Breakdowns
- Reported with one row per
payment_methodvalue, each read against the whole population (share of total)
Notes: Reported per payment method: invoiced amount in the period paid by the method over invoiced amount with a known method.
Data requirements
Grain: Per event · Frequency: Per transaction · Aggregation: event · Staged: no · Main source: Billing.
| Field | Dataset | Type |
|---|---|---|
invoice_amount | invoice | decimal |
invoice_date | invoice | date |
payment_method | invoice | string |
snapshot_date | invoice | date |
Example SQL (Postgres)
SELECT _d.payment_method AS payment_method, (CAST((SELECT COALESCE(SUM(invoice_amount), 0) FROM invoice WHERE snapshot_date = :period_end AND (invoice_date >= :period_start AND invoice_date <= :period_end) AND payment_method = _d.payment_method) AS DOUBLE PRECISION) / NULLIF((SELECT COALESCE(SUM(invoice_amount), 0) FROM invoice WHERE snapshot_date = :period_end AND ((invoice_date >= :period_start AND invoice_date <= :period_end) AND payment_method IS NOT NULL)), 0)) AS payment_method_distribution
FROM (SELECT 'credit_card' AS payment_method UNION ALL SELECT 'ach' AS payment_method UNION ALL SELECT 'wire' AS payment_method UNION ALL SELECT 'check' AS payment_method UNION ALL SELECT 'other' AS payment_method) _d From an agent: with the GASP MCP server, call
lookup_metric({ "name": "Payment Method Distribution" }) or generate_query({ "metric": "Payment Method Distribution", "adapter": "<your adapter JSON>" }).
What It Tells You
Collection risk and processing costs by method.