Report recurring charges for commitment-based discounts over a period
Inspect the result, its parameters and the SQL behind it.
- Source
- FOCUS use-case library
- Data
- FOCUS 1.0 sample
- Status
- Runs on sample
- Mode
- Read-only
- Library snapshot (UTC)
- 2026-10-08
- Source
- FOCUS 1.0 sample
- Result rows
- 2
- Status
- Runs on sample
- Execution
- Precomputed
- Result snapshot (UTC)
- 2026-10-11
Recurring commitment charges
2 rows. Scroll inside the table to see more.
Inspect Postgres SQL and original FOCUS SQL
Postgres SQL, as run
select billing_period_start,
commitment_discount_id,
coalesce(commitment_discount_name, regexp_replace(commitment_discount_id, '^.*/', '')) as commitment_label,
commitment_discount_name,
commitment_discount_type,
charge_frequency,
sum(billed_cost) as total_billed_cost
from focus.cost_and_usage
where billing_period_start >= $1::timestamptz
and billing_period_start < $2::timestamptz
and charge_frequency = 'Recurring'
and commitment_discount_id is not null
group by 1, 2, 3, 4, 5, 6
order by billing_period_start, total_billed_cost desc nulls last, commitment_discount_id
limit 500Original FOCUS SQL
SELECT BillingPeriodStart, CommitmentDiscountId, CommitmentDiscountName, CommitmentDiscountType, ChargeFrequency, SUM(BilledCost) AS TotalBilledCost FROM focus_data_table WHERE BillingPeriodStart >= ? AND BillingPeriodStart < ? AND ChargeFrequency = 'Recurring' AND CommitmentDiscountId IS NOT NULL GROUP BY BillingPeriodStart, CommitmentDiscountId, CommitmentDiscountName, CommitmentDiscountType, ChargeFrequency