---
schema_version: "1"
id: aa0afba8c6fe48e52a2a1ace9975f2477c91661f150208caa45da585d999df7a
title: String Functions for Unconverted 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_stringfunctions_simple.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_stringfunctions_simple.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7dccf867c60628e511f1073fdf8d00dcfa529a97159de62236b227d22a1cf0a5
description: Use string functions to create values based on other strings. For example, you can change the casing of text strings, concatenate values from multiple columns, and replace values. The arguments for string functions must be text strings or dimension columns. If your recipe was upgraded to Data Prep, but your recipe doesn’t convert, this topic is for your unconverted recipe.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# String Functions for Unconverted Formulas

Use string functions to create values based on other strings. For example, you can change the casing of text strings, concatenate values from multiple columns, and replace values. The arguments for string functions must be text strings or dimension columns. If your recipe was upgraded to Data Prep, but your recipe doesn’t convert, this topic is for your unconverted recipe.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note To get a list of string functions for a Data Prep recipe, see [String Functions for Formula Fields](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_data_prep_recipe_formula_field_stringfunctions.htm&release=264.0.0&type=5 "Use string functions to create values in a formula field based on one or more dimension columns in your recipe or strings. For example, you can change the casing of text strings, concatenate values from multiple columns, and replace values.").

For example, you can nest string functions in an expression to combine the sales territory and country into a single column. Then you can apply title casing to the results.

`title(concat(Sales_Territory, ‘ ‘,Country))`

When you enter a formula, text strings must be enclosed in single straight quotes (`’This is a string.’`). Column names must be enclosed in square brackets (`[Opportunity_Name]`).

You can use these string 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:11.614401858304298%">
        <col style="width:17.18931475029036%">
        <col style="width:71.19628339140534%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d66626e68">String Function</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d66626e71">Description</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d66626e74">Syntax</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>concat</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Returns a string by concatenating the values of the specified columns and input
            strings. For example, to display the close date as MM-DD-YYYY, concatenate the
            Close_Date_Month column, Close_Date_Day column, and Close_Date_Year column, and add a
            dash between each of them.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>concat(<samp class="parmname">string1</samp>,<samp class="parmname">string2</samp>,...)</code>
            </p>
            <p><samp class="parmname">string1</samp>
              is the first dimension column or text string to include in the concatenated
              value.</p>
            <p><samp class="parmname">string2</samp> is the second dimension column or text
              string to include.</p>
            <div>
              <p>Example: To create the full name, concatenate the first and
                last names with a space in between
                them.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>concat([OwnerId.FirstName],' ',[OwnerId.LastName])</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>lower</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Returns a string with all characters from the input string in lowercase. If the
            input string is null, then the result is null.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>lower(<samp class="parmname">string</samp>)</code>
            </p>
            <p><samp class="parmname">string</samp> is the
              dimension column or text string to convert to lowercase.</p>
            <div>
              <p>Example: The
                Account.Industry column uses different casing for industries, like “Media” and
                “media.” To apply consistent casing to the column values, convert them to
                lowercase.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>lower([Account.Industry])</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>ltrim</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Removes the specified substring or leading spaces from the beginning of a
            string.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>ltrim(<samp class="parmname">string</samp>,[<samp class="parmname">substring</samp>]</code>
            </p>
            <p><samp class="parmname">string</samp>
              is the dimension column or text string to remove the leading spaces or specified
              substring from.</p>
            <p><samp class="parmname">substring</samp> is the value to remove from the
              string. This parameter is optional. If you don’t specify a substring, the
              transformation removes the leading spaces.</p>
            <div>
              <p>Example: Trim the leading space
                characters from a
                string.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>ltrim('     5 Spaces Before')</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>replace</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Replaces a substring with the specified characters. If any of the arguments are
            null, then the function returns null. This function is case-sensitive.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>replace(<samp class="parmname">string</samp>,<samp class="parmname">searchString</samp>,<samp class="parmname">replacementString</samp>)</code>
            </p>
            <p><samp class="parmname">string</samp>
              is the dimension column or text string that contains the substring to be
              replaced.</p>
            <p><samp class="parmname">searchString</samp> is the substring to replace. If
              searchString is an empty string, the function returns
              null.</p>
            <p><samp class="parmname">replacementString</samp> is the value that replaces the
              substring.</p>
            <div>
              <p>Example: Change the account name from “salesforce.com” to
                “Salesforce” in the Account_Name
                column.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>replace([Account_Name],'salesforce.com','Salesforce')</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>rtrim</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Removes the specified substring or trailing spaces from the end of a
            string.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>rtrim(<samp class="parmname">string</samp>,[<samp class="parmname">substring</samp>]</code>
            </p>
            <p><samp class="parmname">string</samp>
              is the dimension column or text string to remove the trailing spaces or specified
              substring from.</p>
            <p><samp class="parmname">substring</samp> is the value to remove from the
              string. This parameter is optional. If you don’t specify a substring, the
              transformation removes the trailing spaces.</p>
            <div>
              <p>Example: Trim the 2 trailing space
                characters from a
                string.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>rtrim('2 Spaces After  ')</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>substr</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Returns characters from the string, starting at the specified position and of the
            specified length.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>substr(<samp class="parmname">string</samp>,<samp class="parmname">position</samp>,[<samp class="parmname">length</samp>])</code>
            </p>
            <p><samp class="parmname">string</samp>
              is the dimension column or text string to extract the substring
              from.</p>
            <p><samp class="parmname">position</samp> is the starting character position of
              the substring. The first character in a string is at position 1. If position is
              negative, then the position is relative to the end of the string. A position of -1
              denotes the last character.</p>
            <p><samp class="parmname">length</samp> is the number of
              characters to return. If length is 0, the output is an empty string. If length is
              negative, then the function returns null. This parameter is optional.</p>
            <div>
              <p>Example:
                Return the 13th, 14th, and 15th character from each account
                ID.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>substr([Account_Id],13,3)</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>title</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Returns the string with the initial character of every word in uppercase and the
            remaining characters in lowercase. For example, “united states” becomes “United
            States.”</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>title(<samp class="parmname">string</samp>)</code>
            </p>
            <p><samp class="parmname">string</samp> is the
              dimension column or text string on which to apply title casing.</p>
            <div>
              <p>Example: Apply
                title casing on the opportunity names to ensure consistent casing on these
                values.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>title([Opp_Name])</code></pre>
            </div>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>trim</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">
            <p>Removes the specified substring (or leading and trailing spaces) from the string.
            </p>
            <p style="margin-bottom:0;">Use the trim function in a SAQL query to trim other types of characters.</p>
          </td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>trim(<samp class="parmname">string</samp>,[<samp class="parmname">substring</samp>])</code>
            </p>
            <p><samp class="parmname">string</samp>
              is the dimension column or text string to remove the specified substring
              from.</p>
            <p><samp class="parmname">substring</samp> is the value removed from the string.
              This parameter is optional. If you don’t specify a substring, the transformation
              removes the leading and trailing spaces.</p>
            <p>Example: Remove the two leading
              spaces before and after a
              string.</p>
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>trim('  Spaces Before and After  ')</code></pre>
          </td>

        </tr>
        <tr class="">
          <td data-label="String Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e68 ">
            <code>upper</code>
          </td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e71 ">Returns the string with all characters in uppercase. If string is null, then the
            result is null.</td>

          <td data-label="Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d66626e74 ">
            <p>
              <code>upper(<samp class="parmname">string</samp>)</code>
            </p>
            <p><samp class="parmname">string</samp> is the
              dimension column or text string to convert to uppercase.</p>
            <div>
              <p>Example: You have a
                column First_Name that accepts freeform entry for users to enter their first name.
                As a result, some names are in uppercase, some in lowercase, and others in mixed
                case. Convert them to all to uppercase characters to make the casing
                consistent.</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>upper([First_Name])</code></pre>
            </div>
          </td>

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