Analyze service costs by subaccount
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
Loading sample results
Inspect the result, its parameters and the SQL behind it.
10 rows. Scroll inside the table to see more.
select charge_period_start,
sub_account_id,
sub_account_name,
service_name,
sum(effective_cost) as total_effective_cost
from focus.cost_and_usage
where sub_account_id = $1::text
and charge_period_start >= $2::timestamptz
and charge_period_end < $3::timestamptz
group by 1, 2, 3, 4
order by total_effective_cost desc nulls last, charge_period_start, service_name
limit 10SELECT ChargePeriodStart, SubAccountId, SubAccountName, ServiceName, SUM(EffectiveCost) AS TotalEffectiveCost FROM focus_data_table WHERE SubAccountID = ? AND ChargePeriodStart >= ? AND ChargePeriodEnd < ? GROUP BY ChargePeriodStart, SubAccountId, SubAccountName, ServiceName ORDER BY SUM(EffectiveCost) DESC LIMIT 10