Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Applies to:  
Status
colourGreen
titleCelonis 4.0
 
Status
colourGreen
titleCelonis 4.2
 
Status
colourGreen
titleCelonis 4.3
 
Status
colourGreen
titleCelonis 4.4
 
Status
colourGreen
titleCelonis 4.5
 

Description

SUBSTRING returns the substring of size len starting at character with index start.

Substring uses zero-based indexing, i.e., the first character is at start=0. If the requested character range is (partially) outside of the string, only the overlapping part is returned.

Supported input column types: STRING

Output column type: STRING

NULL-values: If the value is NULL, the result is NULL

Syntax

Code Block
languagetext
themeDJango
SUBSTRING ( <table.column>, start, size ) 

Examples


Panel
borderColorgrey
Section
Return substring of size 1 at position 0 (the first addressable position).

Section
Panel
titleQuery
Column1
Code Block
languagetext
themeDJango
SUBSTRING ("Table1"."Column1", 0, 1)
Section
Column
width50%
Panel
titleInput
Table1
Column1 : STRING
'äöüo'
Column
width50%
Panel
titleOutput
Result
Column1 : STRING
'ä'



Panel
borderColorgrey
Section
Return substring of size 1 at position 1 (the second addressable position).

Section
Panel
titleQuery
Column1
Code Block
languagetext
themeDJango
SUBSTRING ("Table1"."Column1", 1, 1)
Section
Column
width50%
Panel
titleInput
Table1
Column1 : STRING
'äöüo'
Column
width50%
Panel
titleOutput
Result
Column1 : STRING
'ö'



Panel
borderColorgrey
Section
Return substring of size 2 at position 3 (the fourth addressable position). As the string ends after position 3, the returned string is of size 1.

Section
Panel
titleQuery
Column1
Code Block
languagetext
themeDJango
SUBSTRING ("Table1"."Column1", 3, 2)
Section
Column
width50%
Panel
titleInput
Table1
Column1 : STRING
'äöüo'
Column
width50%
Panel
titleOutput
Result
Column1 : STRING
'o'