---
schema_version: "1"
id: 693b2f8964b0edaa2deaa0c80a3a01799f0350af7730aa9a43d29f8af34c76ee
title: Numeric Operators and Functions for Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_recipe_numericfunctions.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_numericfunctions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 573508d889b5075bf4096c502de732c72445d57d23486f5fd3dbc4fc8b4d2ae6
description: In CRM Analytics, use numeric functions to calculate values from numbers in your recipe. For example, you can round, truncate, and determine the absolute value of a number. The arguments for numeric functions can be number values or columns.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Numeric Operators and Functions for Formulas

In CRM Analytics, use numeric functions to calculate values from numbers in your recipe. For example, you can round, truncate, and determine the absolute value of a number. The arguments for numeric functions can be number values or columns.

## Numeric Operators and Functions for Formulas

When entering a formula, use the API name of the column in the expression, not the label. The parameters section is surrounded by parentheses. For example, you can enter the following expression.

```
round(Total_Amount/Unit_Price, 2)
```

You can use the following math operators.

 
| Operator | Description |
| --- | --- |
| + | Calculates the sum of two values. |
| \- | Calculates the difference between two values. |
| \* | Multiplies the two values. |
| / | Divides the first value by the second. |
| () | Specifies that the expressions within the parentheses are evaluated first. All other expressions are evaluated using standard operator precedence. |

You can also use the following numeric functions in an expression.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:22.98850574712644%">
          <col style="width:32.41379310344827%">
          <col style="width:44.59770114942529%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d158306e130">Numeric Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d158306e133">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d158306e136">Syntax</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>abs</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Calculates the absolute value of a number. The absolute value of a number is
              the number without its positive or negative sign.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>abs(<samp class="parmname">field</samp>)</code>
              </p>
              <p><samp class="parmname">field</samp> is a
                number value or (measure) field you want to determine the absolute value
                of.</p>
              <p style="margin-bottom:0;">Example: <code>abs(Amount)</code></p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>ceil</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Rounds a number up to the nearest integer.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>ceil(<samp class="parmname">field</samp>)</code>
              </p>
              <p style="margin-bottom:0;"><samp class="parmname">field</samp> is a
                number value or (measure) field you want to round up to the nearest
                integer.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>exp</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Returns a value for e raised to the power of a number you specify.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>exp(<samp class="parmname">field</samp>)</code>
              </p>
              <p style="margin-bottom:0;"><samp class="parmname">field</samp> is a
                number value or (measure) field you want to raise by e.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>floor</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Returns a number rounded down to the nearest integer.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>floor(<samp class="parmname">field</samp>)</code>
              </p>
              <p style="margin-bottom:0;"><samp class="parmname">field</samp> is a
                number value or (measure) field you want to round down to the nearest
                integer.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>format_number</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Formats a number by rounding to the specified number of decimal places or by
              applying a certain format, for example #,###,###.##.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>format_number(<samp class="parmname">expr</samp>,<samp class="parmname">format</samp>)</code>
              </p>
              <p><samp class="parmname">expr</samp>
                is a number value or (measure) field you want to change the format
                of.</p>
              <p><samp class="parmname">format</samp> is the new format to be applied to the
                numbers in the column. The parameter can be in the format composed as
                '#,###,###.##' or actual numerals like ‘12,332.1235’. This parameter is optional.
                If you don’t specify a format, the field is truncated to an
                integer.</p>
              <p style="margin-bottom:0;">Example: <code>format_number(12332.123456,
                    '###,###,###,###,###,###.###')</code> returns <code>12,332.123</code></p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>log</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Returns the logarithm of the number in the base you specify.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>log(<samp class="parmname">value</samp>,<samp class="parmname">field</samp>)</code>
              </p>
              <p><samp class="parmname">value</samp>
                is a number value or (measure) field used as the base of the
                logarithm.</p>
              <p style="margin-bottom:0;"><samp class="parmname">field</samp> is a number value or (measure) field
                you want to take the logarithm of.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>power</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Raises a number to the power of another number.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>power(<samp class="parmname">field</samp>,<samp class="parmname">value</samp>)</code>
              </p>
              <p><samp class="parmname">field</samp>
                is a number value or field you want to raise to the specified
                power.</p>
              <p style="margin-bottom:0;"><samp class="parmname">value</samp> is a number value or (measure) field
                that is the power you want to raise the number to.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>round</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Returns the nearest number to a number you specify, constraining the new number
              by a specified number of digits.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>round(<samp class="parmname">field</samp>,<samp class="parmname">numberOfDigits</samp>)</code>
              </p>
              <p><samp class="parmname">field</samp>
                is a number value or (measure) field you want to
                round.</p>
              <p style="margin-bottom:0;"><samp class="parmname">numberOfDigits</samp> is a number value or (measure)
                field that specifies the number of digits to round the number to.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>sqrt</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Returns the positive square root of a given number.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>sqrt(<samp class="parmname">field</samp>)</code>
              </p>
              <p style="margin-bottom:0;"><samp class="parmname">field</samp> is a
                number value or (measure) field you want to find the square root of.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Numeric Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e130 ">
              <code>truncNumber</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e133 ">Truncates the specified number of decimal values from the number, or converts
              to an integer.</td>

            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d158306e136 ">
              <p>
                <code>truncNumber(<samp class="parmname">field</samp>,<samp class="parmname">scale</samp>)</code>
              </p>
              <p><samp class="parmname">field</samp>
                is a number value or (measure) field you want to
                truncate.</p>
              <p><samp class="parmname">scale</samp> is the number of digits you want to
                the right of the decimal point. This parameter is required. If you don’t specify
                want any decimal values, use a <code>0</code>.</p>
              <p style="margin-bottom:0;">Example: <code>scale(13.111, 1)</code>
                returns <code>13.1</code></p>
            </td>

          </tr>
        </tbody>
      </table>