Calculate Service Quantity

Calculate Service Quantity calculation rules derive or calculate a service quantity that is eventually inserted into the bill segment SQ collection. Calculate Service Quantity calculation rules are generally used to either manipulate measured consumption, or to derive quantities that are not measured by a meter.

  • Rule Name: Calculate Service Quantity
  • Base Package Calculation Rule Business Object: C1-CalculateServiceQuantity
  • Apply Calculation Rule Algorithm Type / Algorithm: C1-CALC-SQ
  • Rule Parameters:
    • Scalar Variable 1 (Scalar Variable 2, Scalar Variable 3, ... Scalar Variable 5): Defines one of the scalar variables to be used in the calculation. When used in formulas, scalar variables are designated as Vn, where n matches the number assigned to the variable (i.e. V1 = Scalar Variable 1, V2 = Scalar Variable 2, etc.).
      • Type: Defines the type of variable and can be one of the following:
        • Algorithm: an algorithm is responsible for retrieving the scalar variable value, e.g. calculate number of days in the bill period.
        • Bill Factor: the value for a specified bill factor that is in effect for the period.
        • Calculated Line: the value is derived by summing previously calculated lines defined as members of a target category.
        • Characteristic Value: the value is derived by summing characteristic values of a given characteristic type.
        • Contract Quantity: the value for a given contract quantity type specified on a service agreement.
        • Historical Service Quantity: the value is derived based on the SA's historical bill segment service quantities for the specified UOM / TOU / SQI. The Aggregate Function defines the calculation to perform on the set of historical service quantities retrieved to derive a single value. Average, Maximum, Minimum and Sum are supported.
        • Service Quantity: service quantities from the bill period's SQ collection, based on a specified UOM / TOU / SQI. This type of variable allows this rule to make use of values calculated by other rules.
        • Previous Quantity: the value is derived from the SA's most recent frozen bill segment service quantities for the specified UOM / TOU / SQI.

      • Missing Value Action: Defines what should take place if the system is unable to retrieve or derive a value for a particular scalar variable. Valid options are as follows:
        • Select Error to create an exception
        • Select Skip to exit the rule and process the next rule
        • Select Use Default Value if the scalar variable should be set to the default value specified
    • Calculation Details: Details regarding how the calculation rule performs its calculations:
      • Calculation Rule Processing: Indicates if the rule is Always executed by rate application, even if the consumption details on the original bill segment are to be used when the system recalculates a bill segment. If the rule should not be executed when the consumption details on the original bill segment are used, indicate that the calculation rule should only be executed on the Initial SQ Calculation.
      • Fail Action: Indicates the action to take if an error is encountered when applying the rule's formula. Available options are to either create a bill segment Error, or to Skip the calculation rule.
      • Calculation Rule Output: Specifies whether calculation rule should add or update a Service Quantity entry in the bill period's SQ collection, or create a bill Calculation Line, or Both.
      • Retain SQ: Indicates whether to save the calculated value on the bill segment. If this value is set to No, it means the value will only exist in the SQ collection while the rate engine is calculating. A value of No should be used for SQ entries that do not have to be retained for audit or analytic purposes.
      • Formula Source: Specifies the type of formula to use for the rule. Valid options include "Simple Formula" and "Conditional Formula".
      • Formula: Specify the Simple Formula to apply. Scalar variables to be used in the calculation are designated as Vn, where n matches the number assigned to the variable (i.e. V1 = Scalar Variable 1, V2 = Scalar Variable 2, etc.). Mathematical operations supported include addition, subtraction, multiplication and division. For example: (V1*V2)/2.
        • Conditional Formula: this allows comparison between one or more pairs of operands to determine the specific formula to execute. A conditional formula can utilize one or more conditions. Each condition comprises the following:
          • Operand 1: the first operand in the condition. Can reference an expression with one or more scalar variables (designated as Vn), e.g. [V1+V2] or [(V1/V2)*V3].
          • Operator: the operator used to compare Operand 1 with Operand 2.
          • Operand 2: the second operand in the condition. Can reference an expression with one or more scalar variables, or a constant (similar to Operand 1).
          • True Action: indicates how to proceed if the comparison between the operands is true. Can be one of the following:

            Apply True Formula: indicates that the True Formula be executed.

            Check Next Condition: indicates that the next condition should be checked.

          • True Formula: the formula to apply if True Action is set to Apply True Formula. Can reference an expression with one or more scalar variables (designated as Vn), or a constant.
          • False Action: indicates how to proceed if the comparison between the operands is false. Can be one of the following:

            Apply False Formula: indicates that the False Formula be executed.

          • Check Next Condition: indicates that the next condition should be checked.
          • False Formula: the formula to apply if the False Action is set to Apply False Formula. Can reference a vector (designated as IVn, where n is the number of the vector) or an expression referencing one or more vectors or a scalar variable (designated as Vn).
    • Result: Define the Unit of Measure, Time of Use and/or Service Quantity Identifier to be used if this calculation rule inserts or updates a service quantity in the bill period's SQ collection.
  • Example: This calculation rule calculates total kWh from On Peak and Off Peak service quantities.

    Calculation Group: Calculate KWH

    Calculation Rule: TOTKWH

    Sequence: 10

    Description: Total amount of KWH (On Peak + Off Peak)

    Scalar Variable 1:

    • Type: Service Quantity
    • Missing Value Action: Error
    • Unit of Measure: Kilowatt hour
    • Time of Use: On Peak
    • SQ To Use: Billable

      Scalar Variable 2:

    • Type: Service Quantity
    • Missing Value Action: Error
    • Unit of Measure: Kilowatt hour
    • Time of Use: Off Peak
    • SQ To Use: Billable

      Calculation Details:

    • Calculation Rule Processing: Always
    • Fail Action: Error
    • Calculation Rule Output: Service Quantity
    • Retain SQ: No
    • Formula Source: Simple Formula
    • Formula: V1 + V2

      Result:

    • Unit of Measure: Kilowatt hour