Skip to content

LEFT

The LEFT function returns a specified number of characters from the left side of a text string.

Applicable to

Calculated Columns

Return Value

  • The LEFT function returns a text string containing the specified number of characters from the left side of the input text.
  • If the number character is greater than the length of text, the entire text string is returned.

Remark

  • The LEFT function is useful for extracting a substring from the beginning of a text string.
  • If number character is less than 1, the function returns an empty string.
  • If LEFT is a NULL value, the function returns NULL.

Syntax

LEFT(<expression>,number)

LEFT in Calculated Columns

ExpressionA placeholder in a function that is replaced with the actual column name.
Column NameThe name of the column in the dataset or Datasource that contains the values you want to analyze.
numberNumber of characters you want to extract from the left side of the string.

Steps to Use LEFT Function

  1. Write the LEFT function. For instance LEFT(<expression>,number)
  2. Replace <expression> with VALUE([Column Name]) and replace number with the number of characters you want to extract position of.
  3. Replace the Column Name with the actual name of your column required.
  4. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.

Example

Objective Consider that you have the below sales dataset, your goal is extracting the first 2 substrings in CATEGORY from left.

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITY
2024-01-03BrazilBaby Food38.4143.78742
2024-01-07JapanSpices45.5650.815520
Japan43.787410
2024-01-1832.30194
2024-01-22BrazilCosmetics28.33523.01097
2024-01-26Canada20.18523.01099
2024-01-04FranceCereal25.2628.79649
2024-01-09BrazilCereal44.57550.81558
2024-01-14BrazilSnacks20.1854
BrazilCosmetics40.48546.15292

You can use the LEFT function like

LEFT(VALUE([CATEGORY]), 2)

The new calculated column “Text” will return

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITYTEXT
03-01-2024BrazilBaby Food38.4143.78742Ba
07-01-2024JapanSpices45.5650.815520Sp
Japan43.787410
18-01-202432.30194
22-01-2024BrazilCosmetics28.33523.01097Co
26-01-2024Canada20.18523.01099
04-01-2024FranceCereal25.2628.79649Ce
09-01-2024BrazilCereal44.57550.81558Ce
14-01-2024BrazilSnacks20.1854Sn
BrazilCosmetics40.48546.15292Co