Source
FOCUS 1.0 sample
Result rows
1
Status
Adapted to v1.0
Execution
PrecomputedRead-only
Result snapshot (UTC)
2026-10-11

Share of a service provider's positive effective cost that carries a given tag key. JSON_CONTAINS_PATH becomes the jsonb key-exists operator. tagged_share is a 0-1 ratio for display; tagged_percentage keeps the source's 0-100 scale.

Column adaptations (1)
  • ServiceProviderName → case when publisher_name is not null and publisher_name is distinct from invoice_issuer_name then publisher_name else provider_name end: v1.3 replaced ProviderName with ServiceProviderName (the seller in marketplace scenarios). v1.0 ProviderName supplies it for direct-provider charges; PublisherName supplies it for the observed AWS Marketplace sellers (Datadog, Red Hat) where it differs from InvoiceIssuerName. Same expression as the other v1.3 catalog entries.

Tagged share of effective cost

98.76%
Tagged share
Query results
Tagged shareTagged percentageTagged effective costTotal effective cost
0.999,876.12%$1,435.00$1,453.00

1 row. Scroll inside the table to see more.

Precomputed result

Inspect Postgres SQL and original FOCUS SQL

Postgres SQL, as run

select sum(case when tags ? $1::text then effective_cost else 0 end) / nullif(sum(effective_cost), 0) as tagged_share,
       sum(case when tags ? $1::text then effective_cost else 0 end) / nullif(sum(effective_cost), 0) * 100 as tagged_percentage,
       sum(case when tags ? $1::text then effective_cost else 0 end) as tagged_effective_cost,
       sum(effective_cost) as total_effective_cost
from focus.cost_and_usage
where charge_period_start >= $2::timestamptz
  and charge_period_end < $3::timestamptz
  and effective_cost > 0
  and case when publisher_name is not null and publisher_name is distinct from invoice_issuer_name then publisher_name else provider_name end = $4::text

Parameters: $1 = tag_key, $2 = period_start, $3 = period_end, $4 = service_provider_name

Original FOCUS SQL

SELECT 
    SUM(CASE 
        WHEN JSON_CONTAINS_PATH(tags, 'one', '$.?') 
        THEN EffectiveCost 
        ELSE 0 
    END) / SUM(EffectiveCost) * 100 AS TaggedPercentage
FROM focus_data_table
WHERE ChargePeriodStart >= ? and ChargePeriodEnd  < ?
     AND EffectiveCost > 0
     AND ServiceProviderName = ?