Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[],[],null,["# SUBSTR\n\nReturns a specific sequence of characters from the text.\n\nSample usage\n------------\n\n`SUBSTR(Campaign, 1, 6)`\n\nSyntax\n------\n\n`SUBSTR(`\u003cvar translate=\"no\"\u003eX\u003c/var\u003e`, `\u003cvar translate=\"no\"\u003estart_index\u003c/var\u003e`, `\u003cvar translate=\"no\"\u003elength\u003c/var\u003e`)`\n\n### Parameters\n\n- \u003cvar translate=\"no\"\u003eX\u003c/var\u003e - A field or expression of any type.\n- \u003cvar translate=\"no\"\u003estart_index\u003c/var\u003e - The position from the start of the string from which to begin extracting.\n- \u003cvar translate=\"no\"\u003elength\u003c/var\u003e - The number of characters to extract.\n\n### Notes\n\n- The first character of a field is at index 1.\n- 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.\n\nExamples\n--------\n\nRelated resources\n-----------------\n\n- [Calculated fields](/looker/docs/studio/about-calculated-fields)\n- [Looker Studio function list](/looker/docs/studio/function-list)"]]