Page tree

Release 8.2.2




Matches the leftmost set of characters in a string, as specified by parameter. The string can be specified as a column reference or a string literal.
  • Since the LEFT function matches based on fixed numeric values, changes to the length or structure of a data field can cause your recipe to fail to properly execute.
  • The LEFT function requires an integer value for the number of characters to match. If you need to match strings using patterns, you should use the STARTSWITH  transform instead. See STARTSWITH Function.

Wrangle vs. SQL: This function is part of Wrangle, a proprietary data transformation language. Wrangle is not SQL. For more information, see Wrangle Language.

Basic Usage

Column reference example:


Output: Returns the first three letters of the MyName column value. 

String literal example:

left('Hello, World',5)

Output: Returns the string: Hello.

Syntax and Arguments


ArgumentRequired?Data TypeDescription
column_stringYstringName of the column or string literal to be applied to the function
char_countYinteger (positive)Count of characters from the start of the value to include in the match

For more information on syntax standards, see Language Documentation Syntax Notes.


Name of the column or string constant to be searched.

  • Missing string or column values generate missing string results.
  • String constants must be quoted ('Hello, World').
  • Multiple columns and wildcards are not supported.

Usage Notes:

Required?Data TypeExample Value
YesString literal or column referencemyColumn


Count of characters from the start of the string to include in the match.

  • Value must a non-negative integer. If the value is 0, then the match fails for all strings.
  • If this value is greater than the length of the string, then the match is the entire string.
  • References to columns of integer data type are not supported.

Usage Notes:

Required?Data TypeExample Value
YesInteger (non-negative)5


Tip: For additional examples, see Common Tasks.

Example - Driver's License Type


A California driver license number is one alphabetical character followed by seven digits (e.g., A1234567). The following is a set of California driver's license values:


The LicenseID value contains the license class as the first character of the value. For example, Baker's license is a Commercial Class B license. 


To extract the license type into a separate column, you can use the following transformation:

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula left(LicenseID,1)



You can rename the new column to LicenseType.

This page has no comments.