SUBSTR

Returns a specific sequence of characters from the text.

Sample usage

SUBSTR(Campaign, 1, 6)

Syntax

SUBSTR(X, start index, length)

Parameters

  • X - a field or expression of any type.
  • start index - the position from the start of the string from which to begin extracting.
  • length - the number of characters to extract.

Notes

  • The first character of a field is at index 1.
  • To begin extracting from the end of the string, use a negative index. The last character of a string is at index -1, the second to the last is at -2, etc.

Examples

Example formula Input Output
SUBSTR(Campaign, 1, 6) Summer Sale Summer
SUBSTR(Campaign, -4, 4) Summer Sale Sale

Related resources

Was this helpful?

How can we improve it?
true
Get Looker Studio Pro

Upgrade now to get all the features of Looker Studio that you already know, plus enhanced enterprise capabilities and technical support

Search
Clear search
Close search
Google apps
Main menu
858745824332629884
true
Search Help Center
true
true
true
true
true
102097