THE LINUX FOUNDATION PROJECTS
Docs navigation
On this page

    2.3 Charge Categorization

    Since: 1.0

    2.3.1 Description

    FOCUS supports the categorization of charges including purchases, usage, tax, credits and adjustments. It includes classification on frequency. It includes classification on correction vs normal entries.

    2.3.2 Directly Dependent Columns

    2.3.3 Supporting Columns

    2.3.4 Example SQL Query

    2.3.4.1 Report on Commitment Discount Purchases

    SELECT
      MIN(ChargePeriodStart) AS ChargePeriodStart,
      MAX(ChargePeriodEnd) AS ChargePeriodEnd,
      ServiceProviderName,
      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
      ServiceProviderName,
      BillingAccountId,
      CommitmentDiscountId,
      CommitmentDiscountType,
      CommitmentDiscountUnit,
      CommitmentDiscountQuantity,
      ChargeFrequency

    2.3.4.2 Report on Corrections

    SELECT
      ServiceProviderName,
      BillingAccountId,
      ChargeCategory,
      ServiceCategory,
      ServiceName,
      SUM(BilledCost) AS TotalBilledCost
    FROM focus_data_table
    WHERE BillingPeriodStart >= ? AND BillingPeriodEnd < ?
      AND ChargeClass = 'Correction'
    GROUP BY
      ServiceProviderName,
      BillingAccountId,
      ChargeCategory,
      ServiceCategory,
      ServiceName

    2.3.4.3 Report Recurring Charges

    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