THE LINUX FOUNDATION PROJECTS
Docs navigation
On this page

    2.8 Cost Comparison

    Since: 0.5
    Updated: 1.4

    2.8.1 Description

    FOCUS supports comparing cost columns to identify savings from negotiated discounts, the impact of commitment discount amortization, and differences between cash-based and accrual-based cost perspectives.

    BilledCost represents the cash-based view: amounts invoiced by the InvoiceIssuerName in a given billing period. EffectiveCost represents the accrual-based view: costs recognized when resources are consumed, services are used, or contract commitments are recognized. ListCost provides the pre-discount baseline. ContractedCost reflects pricing after negotiated discounts.

    Comparing ListCost against ContractedCost quantifies negotiated discount savings; comparing ContractedCost against EffectiveCost isolates commitment discount savings; comparing EffectiveCost against ListCost shows total combined savings. BilledCost and EffectiveCost diverge when billing timing differs from consumption, such as with commitment discounts or prepaid purchases.

    When comparing costs across marketplace boundaries, practitioners should be aware that BilledCost is zero for charges generated by entities not responsible for invoicing, so BilledCost and EffectiveCost sums may not align within a single dataset when covering charges and covered charges span multiple invoice issuers. This is expected and does not indicate a data quality issue. See the Marketplace Purchases supported feature, Examples: Commitment Discount Flexibility, and Examples: SaaS for additional context.

    2.8.2 Directly Dependent Columns

    2.8.3 Supporting Columns

    2.8.4 Example SQL Queries

    2.8.4.1 Discount Effectiveness by Service

    WITH AggregatedData AS (
      SELECT
        ServiceProviderName,
        BillingAccountId,
        BillingAccountName,
        BillingCurrency,
        ServiceName,
        SUM(EffectiveCost) AS TotalEffectiveCost,
        SUM(BilledCost) AS TotalBilledCost,
        SUM(CASE
              WHEN ChargeCategory = 'Usage' AND BilledCost = 0 AND EffectiveCost != 0
              THEN 0
              ELSE ContractedCost
            END) AS TotalContractedCost,
        SUM(CASE
              WHEN ChargeCategory = 'Usage' AND BilledCost = 0 AND EffectiveCost != 0
              THEN 0
              ELSE ListCost
            END) AS TotalListCost
      FROM focus_data_table
      WHERE BillingPeriodStart >= ?
        AND BillingPeriodEnd < ?
        AND ChargeClass IS NULL
      GROUP BY
        ServiceProviderName,
        BillingAccountId,
        BillingAccountName,
        BillingCurrency,
        ServiceName
    )
    SELECT ServiceProviderName,
        BillingAccountId,
        BillingAccountName,
        BillingCurrency,
        ServiceName,
        TotalEffectiveCost,
        TotalBilledCost,
        TotalListCost,
        (1 - TotalContractedCost / NULLIF(TotalListCost, 0)) * 100 AS ContractedDiscount,
        (1 - TotalEffectiveCost / NULLIF(TotalListCost, 0)) * 100 AS EffectiveDiscount
    FROM AggregatedData

    2.8.4.2 Cash vs. Accrual Comparison by Billing Period

    SELECT
      ServiceProviderName,
      InvoiceIssuerName,
      BillingPeriodStart,
      BillingPeriodEnd,
      SUM(BilledCost) AS TotalBilledCost,
      SUM(EffectiveCost) AS TotalEffectiveCost,
      SUM(EffectiveCost) - SUM(BilledCost) AS CostBasisDifference
    FROM focus_data_table
    WHERE BillingPeriodStart >= ? AND BillingPeriodEnd < ?
    GROUP BY
      ServiceProviderName,
      InvoiceIssuerName,
      BillingPeriodStart,
      BillingPeriodEnd
    HAVING ABS(SUM(EffectiveCost) - SUM(BilledCost)) > 0.01