THE LINUX FOUNDATION PROJECTS
Docs navigation
On this page

    Report commitment discount purchases

    This query uses the Provider column. Provider is deprecated in v1.3 and will be removed in v1.4.

    FOCUS Versions

    v1.0 v1.1 v1.2

    Context

    Tracking and reconciling commitment-based discount purchases across providers is a key to success for FinOps.

    FOCUS SQL Query

    SELECT
      MIN(ChargePeriodStart) AS ChargePeriodStart,
      MAX(ChargePeriodEnd) AS ChargePeriodEnd,
      ProviderName,
      BillingAccountId,
      CommitmentDiscountId,
      CommitmentDiscountType,
      CommitmentDiscountUnit,
      CommitmentDiscountQuantity,
      ChargeFrequency,
      SUM(BilledCost) AS TotalBilledCost
    FROM focus_data_table
    WHERE ChargePeriodStart >= ? AND ChargePeriodEnd < ?
      AND ChargeCategory = 'Purchase'
      AND CommitmentDiscountId IS NOT NULL
    GROUP BY
      ProviderName,
      BillingAccountId,
      CommitmentDiscountId,
      CommitmentDiscountType,
      CommitmentDiscountUnit,
      CommitmentDiscountQuantity,
      ChargeFrequency

    FOCUS Datasets

    FOCUS Columns