Formula building in a calculated metric definition

  • Release version: Australia
  • Updated March 12, 2026
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Formula building in a calculated metric definition

    In a calculated metric definition within ServiceNow, you can create formulas using operands, operators, and functions to perform calculations on metric data. This capability enables you to derive new metrics by combining existing metric definitions, such as calculating total employee count from male and female employee metrics. Operators include basic arithmetic symbols like addition (+), subtraction (-), multiplication (), and division (/).

    Show full answer Show less

    Key Features

    • Operands and Default Values: Operands are metric definitions used in formulas. You can set default values for operands via the Calculated Metric Definition Settings table to ensure calculations complete even if operand values are missing.
    • Formula Versions: Each time you save changes to a formula after execution, a new version is created with defined applicable date ranges. This allows tracking and management of formula changes over time.
    • Calculation Levels: Formulas can be built at two levels:
      • Metric Definition Level: Uses data aggregated across all child metrics for calculation.
      • Entity Level: Creates child metrics for each unique entity tied to operand metrics, supporting entity-specific calculations and aggregation.
      Note that only scheduled child metric task data is included in calculations; ad hoc metric data is excluded.
    • Formula Building Tools: You must configure the formula context, including tables and identifiers, before building formulas. The formula builder supports importing formulas from Microsoft Excel spreadsheets for faster setup.
    • Editing and Activation: Formulas can be edited anytime to update calculation logic or historical results. Default operand values can be activated or customized to ensure uninterrupted calculations.

    Practical Benefits for ServiceNow Customers

    This functionality empowers you to create flexible and accurate calculated metrics tailored to your organizational needs. By utilizing default values, version control, and multiple calculation levels, you can maintain reliable metric calculations even as data or requirements evolve. The ability to import formulas and edit them post-execution simplifies formula management and accelerates metric development.

    In a calculated metric definition, you can build formulas using operands, operators, and functions to perform calculations on metric data.

    A formula consists of operands, operators, and functions. For example, to calculate the total employee count from two metric definitions (number of male employees and number of female employees), the metric definitions are the operands, and the operator is the symbol or function that performs a specific operation on the operands to produce a result. Examples of operators include addition (+), subtraction (-), multiplication (*), and division (/).

    Default values for formula operands

    You can set default values for operands in the Calculated Metric Definition Settings table. When a formula encounters an operand with no value, the system applies the configured default value from this table and completes the calculation. You can activate the shipped default record or create a custom entry with preferred values for specific operands.

    Formula versions

    Each time you save an edited formula on a calculated metric definition that has been executed, a new formula version is created. Formula versions are listed in the Versions related list on the calculated metric definition. Each version has an Applicable from date and an Applicable to date. The Applicable to date is empty for the currently active version and is set to the day before the new version's Applicable from date when a newer version is saved.

    You can edit a formula at any time, including after the calculated metric definition has been executed. For more information, see Edit a calculated metric definition formula.

    Formula calculation levels

    When you build a formula in a calculated metric definition, you can build it at either the metric definition level or the entity level. Before you save the calculated metric definition and build the formula for metric definition score calculation, you must specify the calculation level in the Calculation level field. The two levels are as follows:
    • Metric definition: If you select Metric definition in the Calculation level field, the data across all child metric definitions or child metrics is used for calculation. When you select Execute, the formula is applied and the calculated metric definition data is generated. For more information, see Configure the formula builder.
    • Entity: If you select Entity in the Calculation level field and specify the calculation method using the formula builder, child metrics are created for the calculated metric definition. These metrics are created for each distinct entity associated with the metric definitions used as operands in the formula. When you select Execute, the formula is applied and the metric data is generated. When you select Aggregate, the metric data is aggregated and the calculated metric data is generated.
    Important:

    Ad hoc metric data from child metrics is not included in CMD formula calculations at either level. Only data from scheduled child metric tasks feeds into the CMD score. For more information, see Ad hoc metric data task limitations.