Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Dan Gorman edited this page Nov 29, 2018 · 3 revisions

The LEFT Function

Function Group: Text

LEFT returns the leftmost segment of a string, as specified by a segment position argument.

Syntax

LEFT(arg1, arg2)

  • arg1 is the string to be segmented
  • arg2 is optional, and is the point at which to segment the strings (defaults to 1)

Uses

Let's say we're given a response with an id:

{  
   "data":{  
      "ids":{  
         "id_1": "1anb4amca051"
      }
   }
}

If we are only interested in the first 5 digits of the id, we can get them with LEFT:

LEFT(data.ids.id_1, 5)

which returns 1anb4.

Notes

To get characters from the right side of a string, use RIGHT

Unlike RIGHT, the segment position argument for LEFT is counted from left to right, as opposed to right to left.

Clone this wiki locally