---
schema_version: "1"
id: 06b6c6cc4e8ff3ae6adff79e9f57c59ca6c7fc0bf32718fda6912f4382e8b89f
title: Multivalue 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_multivaluefunctions.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_multivaluefunctions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: dd0fa0a54c65a8582f35d1b6f54477fd22ba7abad6b3a21032c196c8dcaa2e82
description: In CRM Analytics, use multivalue functions with your multivalue data. For example, look for a specific value, count how many values there are, create a new multivalue by combining other text, convert a multivalue to a string, or split a string and return a multivalue. The arguments for multivalue functions must be text strings or fields.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Multivalue Functions for Formulas

In CRM Analytics, use multivalue functions with your multivalue data. For example, look for a specific value, count how many values there are, create a new multivalue by combining other text, convert a multivalue to a string, or split a string and return a multivalue. The arguments for multivalue functions must be text strings or fields.

When you enter a formula, use the API name of the column in the expression, not the label. The parameters section is surrounded by parentheses. Also, text strings must be enclosed in single straight quotes (`'This is a string.'`).

You can use the following multivalue functions in a formula 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="d159387e36">Multivalue Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d159387e38">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d159387e40">Syntax</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>split</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Splits a string at the specified delimiter and returns a multivalue. If
                <samp class="parmname">limit</samp> is specified, then returns at most the number of
                specified number of splits.
              </p>
              <ul>
                <li>Input: text, text</li>
                <li>Output: multivalue</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>split(<samp class="parmname">field</samp>,<samp class="parmname">delimiter</samp>,
                    <samp class="parmname">limit</samp>(optional))</code></p>
              <p><samp class="parmname">field</samp> is
                the text (dimension) field or string to be converted to a
                multivalue.</p>
              <p><samp class="parmname">delimiter</samp> is the value to separate the
                elements in the string. It can be a field or a text
                string.</p>
              <p style="margin-bottom:0;"><samp class="parmname">limit</samp> is the maximum number of elements
                returned in the multivalue. This parameter if optional. It can be a field or a
                number.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>array_join</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Converts the multivalue to a string with elements separated by the specified
                delimiter. If no string is specified for <samp class="parmname">nullReplacement</samp>, nulls
                are ignored.</p>
              <ul>
                <li>Input: multivalue, text</li>
                <li>Output: text</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>array_join(<samp class="parmname">mvField</samp>,<samp class="parmname">delimiter</samp>,<samp class="parmname">nullReplacement</samp>(optional))</code></p>
              <p><samp class="parmname">mvField</samp>
                is the multivalue text column to be converted to a
                string.</p>
              <p><samp class="parmname">delimiter</samp> is the value to separate the
                elements in the string. It can be a field or a text
                string.</p>
              <p style="margin-bottom:0;"><samp class="parmname">nullReplacement</samp> is the value that replaces
                the nulls. This parameter is optional. It can be a field or a text
                string.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>array_contains</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Returns TRUE if the specified string is found in the multivalue.</p>
              <ul>
                <li>Input: multivalue, text</li>
                <li>Output: text (true/false)</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>array_contains(<samp class="parmname">mvField</samp>,<samp class="parmname">literal</samp>)</code></p>
              <p><samp class="parmname">mvField</samp>
                is the multivalue field or column to be
                searched.</p>
              <p style="margin-bottom:0;"><samp class="parmname">literal</samp> is the value to search for at the
                beginning of the field. It can be a field or a text string.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>size</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Returns the number of elements in the multivalue. If the multivalue is null,
                returns <code>-1</code>.</p>
              <ul>
                <li>Input: multivalue</li>
                <li>Output: number</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>size(<samp class="parmname">mvField</samp>)</code></p>
              <p><samp class="parmname">mvField</samp> is the
                multivalue text field to measure.</p>
              <p style="margin-bottom:0;">When filtering out multivalue fields with
                both empty values and null values, to get consistent results between interactive
                preview and batch run results, use <code>size(mvField)&lt;1</code> and
                not<code> size(mvField)=-1</code></p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>array</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Returns a multivalue containing unique elements.</p>
              <ul>
                <li>Input: text</li>
                <li>Output: multivalue</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>array(<samp class="parmname">field1</samp>,<samp class="parmname">field2</samp>,...<samp class="parmname">fieldN</samp>)</code></p>
              <p><samp class="parmname">field1</samp>
                is the first text column or string to include in the concatenated
                value.</p>
              <p><samp class="parmname">field2</samp> is the second text (dimension) column
                or string to include.</p>
              <p style="margin-bottom:0;"><samp class="parmname">fieldN</samp> is any number of extra
                text (dimension) columns or strings to include.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>element_at</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Returns the element of a multivalue at the given index.</p>
              <ul>
                <li>Input: multivalue, integer</li>
                <li>Output: text</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>element_at(<samp class="parmname">mvField</samp>,
                    <samp class="parmname">index</samp>)</code></p>
              <p><samp class="parmname">mvField</samp> is the
                multivalue field to return the element from.</p>
              <p style="margin-bottom:0;"><samp class="parmname">index</samp> is
                the index to use in the array.</p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Multivalue Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e36 "><code>array_distinct</code></td>
            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e38 ">
              <p>Removes duplicates from the multivalue.</p>
              <ul>
                <li>Input: multivalue</li>
                <li>Output: multivalue</li>
              </ul>
            </td>
            <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d159387e40 ">
              <p><code>array_distinct(<samp class="parmname">mvField</samp>)</code></p>
              <p style="margin-bottom:0;"><samp class="parmname">mvField</samp>
                is the multivalue field to remove duplicates from.</p>
            </td>
          </tr>
        </tbody>
      </table>