---
sourceDocument: Yokohama Environmental, Social, and Governance Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/environmental-social-governance

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Environmental, Social, and Governance Management

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: Yokohama
* 
* Updated July 31, 2025
* 
* ![](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 the calculated metric definition, you can create formulas for performing calculations on various data types.
Formulas consist of operands (data points), operators (symbols/functions that perform operations), and functions.
For example, to calculate the total employee count, you would use the number of male and female employees as operands, with the addition operator.
Show full answer Show less  

## Key Features

* **Default Values:** Set default values for operands to ensure calculations proceed smoothly, even with missing data. This reduces manual intervention and enhances reliability.
* **Calculation Levels:** Formulas can be built at either the metric definition level or the entity level. Choose the calculation level in the calculated metric definition form to determine how data is aggregated.
* **Importing Formulas:** You can directly import formulas from Microsoft Excel spreadsheets, facilitating quick formula creation.
* **Custom Formula Creation:** Build formulas using either entities or metric definitions tailored to your specific requirements.

## Key Outcomes

Using the calculated metric definition, you can effectively manage metrics by ensuring uninterrupted calculations, customizing for specific operand needs, and generating reliable metric data. This results in consistent and accurate metric evaluations across varying data conditions.  
In a calculated metric definition, you can create formulas to perform calculations for any data that you may require.

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

You can set default values for operands in the Calculated Metric Definition Settings table to ensure metric calculations continue smoothly even when data is missing or undefined. When a formula encounters an empty operand, the
system automatically applies the configured default value from this table, allowing the calculation to proceed without interruption. Users can activate the shipped default record or create custom entries with preferred values for
specific operands. This setup enhances the reliability and flexibility of metric logic, reduces manual intervention, and supports consistent results across varying data conditions.  
When you build a formula in a calculated metric definition, you can choose to build it at either the metric definition level or at the entity level. Before you save the calculated metric definition form and build the formula for metric definition score calculation, you must specify the calculation level in the calculated metric definition form. The two levels are as follows:

* Metric definition: If you select Metric definition in the Calculation level field, then 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://servicenow-prod.fluidtopics.net/aa0T18NnguxFSse30mJmVA "Specify the formula context, the tables, and the identifiers before you can build a formula."). The following image shows how calculation occurs at the metric definition level:
* Entity: If you select Entity in the Calculation level field and specify the calculation method using the formula builder, then the child metrics are created for the calculated metric definition. These metrics are created for each distinct entity that is associated with the metric definitions that have been used as operands in the formula. When you Execute the metric definition, the formula is applied and the metric data is generated. When you Aggregate the metric definition, the metric data is aggregated and the calculated metric data is generated. The following image shows how calculation occurs at the entity level:
{#formula-building-at-metric-definition-and-entity-level__ul_ifc_45q_25b}
* **[General guidelines for formula building](https://servicenow-prod.fluidtopics.net/cdGTiMZ_CANKWWvI_bgSLg)**   
  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://servicenow-prod.fluidtopics.net/aa0T18NnguxFSse30mJmVA)**   
  Specify the formula context, the tables, and the identifiers before you can build a formula.
* **[Import a formula into a calculated metric definition](https://servicenow-prod.fluidtopics.net/Mq7H0rzxwbOyf8JDUufIEg)**   
  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://servicenow-prod.fluidtopics.net/0YIw_U~zFFr6JUn4nyOhVw)**   
  Build your own formula using either entities or metric definitions.
* **[Activate default values for CMD calculations](https://servicenow-prod.fluidtopics.net/pRLw6LUaH47hnjzwRvzcdQ)**   
  Activate default values for missing operands in CMD formulas using the Calculated Metric Definition Settings table, or configure new records as needed. This ensures uninterrupted calculations and allows customization for specific operand requirements.

