Working with Compound Aggregation Calculations - m3ter Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

For many usage-based pricing use cases, you can use Compound Aggregation calculations to reference one or more simple Aggregations and resolve complex pricing requirements - they’re the complexity crunchers! By exploiting the powerful m3ter Calculation Engine, there’s virtually no limit to the flexibility they give you for defining the precise pricing metrics you need. And it’s worth noting that you can create a Compound Aggregation that does not reference a single simple Aggregation, giving you a pricing metric not determined by metered usage, but is nevertheless essential for your complex, mixed-pricing use case. This topic explains the different types of field you can reference in your Compound Aggregation calculations and the correct formats for those field references:

Important! If you’re reviewing this topic for help in using Compound Aggregation calculations, please also see further details of the operators, variables, functions, and type casts at m3ter Calculation Engine.

Referencing Simple Aggregation Values

You can reference the resultant values of simple Aggregations in a Compound Aggregation calculation using a simple Aggregation’s Code. The general format is:

aggregation.<aggregationCode>

The simple Aggregations you can reference when you create a Product-specific Compound Aggregation or a Global Compound Aggregation are the same:

You can reference Segmented Aggregations in a Compound Aggregation. The segments defined for the referenced Aggregations that are made available to the Compound Aggregation depend on whether it references one or many Segmented Aggregations - see Compound Aggregations - Segments Available.

Important! Compound Aggregation Calculations Use Base Values of Simple Aggregations. If a simple Aggregation referenced by a Compound Aggregation has a Quantity per unit defined for pricing and billing purposes or a Rounding defined, then these will not be factored into the value used by the calculation. For example, if a simple Aggregation referenced has a base value of 100 and has a Quantity per unit set at 10, any Compound Aggregation calculation that references it will use the base value of 100 and not 10.

Referencing Custom Fields in Compound Aggregations

You can reference the values for Custom Fields defined at both Organization level or individual entity in your Compound Aggregation calculations using the following format for the following entities:

When you reference a Custom Field in a calculation, the value defined for the Custom Field at the Organizational level will be used unless you’ve also defined a Custom Field at the individual entity level. If a Custom Field has also been defined at the individual entity level, this value will be used:

Important! Aggregation and Compound Aggregation Custom Fields. You can also define Custom Fields for Aggregations and Compound Aggregations. However, these Custom Fields are NOT supported for referencing in Compound Aggregation calculations.

Exception - Referencing Individual Meter Custom Fields

The exception to the general rule is:

Even if you’ve created a Custom Field at the individual Meter level, the default value defined for the Custom Field created for Meter at the Organizational-level will be used for the calculation. This is because a Compound Aggregation might reference multiple Aggregations and therefore multiple Meters, which leaves it ambiguous as to which individual Meter’s Custom Field value should be used for the calculation.

Tip: See Also? For creating Custom Fields in the Console, see Managing your Organization. You can use the Create/Edit Console pages for individual entities to set up Custom Fields. For API calls, see the CustomField section of our API Ref Docs. For more background on Custom Fields, see Working with Custom Fields.

Referencing Bill Period Variables

You can reference the following twelve bill period variables in your Compound Aggregation calculations:

How these variables work to determine bill periods can be understood against three distinctions: