---
sourceDocument: Brazil Operational Sustainability Management (formerly Environmental, Social, and Governance)
sourceDocumentLink: https://www.servicenow.com/docs/r/environmental-social-governance

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Operational Sustainability Management (formerly Environmental, Social, and Governance)

ft:clusterId :

    - esgv

bundleId :

    - esgv

workflow :

    - Technology


---

# Formula building in a calculated metric definition

# Formula building in a calculated metric definition {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) 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 (metric definitions), operators (such as +, -, , /), and functions to compute values from metric data.
This capability enables you to define complex calculations, such as totaling employee counts from separate male and female employee metrics, to derive meaningful insights.
Show full answer Show less  

## Default values for operands

When a formula encounters an operand that lacks a value, the system applies a default value configured in the **Calculated Metric Definition Settings** table. You can use the shipped default record or create custom defaults tailored to your needs, ensuring calculations complete even if some data points are missing.

## Formula versions

Each time you save changes to a formula on a calculated metric definition that has already been executed, a new formula version is created. Versions are tracked with applicable date ranges to manage formula lifecycle and historical accuracy. You can edit formulas anytime, including after execution, allowing ongoing refinement of calculations.

## Calculation levels

Formulas can be built at two calculation levels, selectable before saving the calculated metric definition:

* **Metric definition level:** Aggregates data across all child metric definitions or child metrics. Executing the formula generates the calculated metric data based on this combined data.
* **Entity level:** Creates child metrics for each unique entity related to operands. Executing the formula generates metric data per entity, and aggregation of this data produces the final calculated metric.

**Important:** Ad hoc metric data from child metrics is excluded from calculations; only scheduled metric data tasks feed into the calculated metric definition score.

## Guidelines for formula building

* **Configure the formula builder:** Define the formula context, relevant tables, and identifiers before constructing your formula.
* **Import formulas:** You can import formulas from Microsoft Excel spreadsheets directly into calculated metric definitions to accelerate formula creation.
* **Create and edit formulas:** Build formulas using entities or metric definitions, and update existing formulas to refine calculation logic or adjust historical data processing.  
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 {#formula-building-at-metric-definition-and-entity-level__section_t31_r1h_jjc}

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 {#formula-building-at-metric-definition-and-entity-level__section_vl4_y1h_jjc}

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](https://www.servicenow.com/docs/bewulILpwPsqEvnmT3F5Ew "Edit a formula in a calculated metric definition to update the calculation logic or apply changes to historical data.").

## Formula calculation levels {#formula-building-at-metric-definition-and-entity-level__section_usq_5bh_jjc}

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](https://www.servicenow.com/docs/IHIZszSm_Dy~BFULXSj6Hw "Specify the formula context, the tables, and the identifiers before you can build a formula.").
* 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.

{#formula-building-at-metric-definition-and-entity-level__ul_ifc_45q_25b}  
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](https://www.servicenow.com/docs/RW4Jx46~5DliJRoYg63gWg "Ad hoc metric data tasks don't support certain features that are available for scheduled metric data tasks.").
* **[General guidelines for formula building](https://www.servicenow.com/docs/pW8Tel88p7kTbEQBqaQ7Ew)**   
  While building a custom formula in a calculated metric definition, keep these general guidelines in mind to easily create your formulas.
* **[Configure the formula builder](https://www.servicenow.com/docs/IHIZszSm_Dy~BFULXSj6Hw)**   
  Specify the formula context, the tables, and the identifiers before you can build a formula.
* **[Import a formula into a calculated metric definition](https://www.servicenow.com/docs/_Z9N4YnG8ILJJ8abgIc6lQ)**   
  Directly import any formula that is stored in Microsoft Excel spreadsheets into a calculated metric definition. This import helps in quickly building your formula for performing calculations.
* **[Create a formula](https://www.servicenow.com/docs/Fb1wt7Y3W0mXNY614wESCw)**   
  Build your own formula using either entities or metric definitions.
* **[Edit a calculated metric definition formula](https://www.servicenow.com/docs/bewulILpwPsqEvnmT3F5Ew)**   
  Edit a formula in a calculated metric definition to update the calculation logic or apply changes to historical data.

