Applies to:  CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6 

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

SUBSTRING ( table.column, start, size ) 

Examples


[1] Return substring of size 1 at position 0 (the first addressable position).

Query
Column1
SUBSTRING ("Table1"."Column1", 0, 1)
Input
Table1
Column1 : STRING
'äöüo'
Output
Result
Column1 : STRING
'ä'



[2] Return substring of size 1 at position 1 (the second addressable position).

Query
Column1
SUBSTRING ("Table1"."Column1", 1, 1)
Input
Table1
Column1 : STRING
'äöüo'
Output
Result
Column1 : STRING
'ö'



[3] 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.

Query
Column1
SUBSTRING ("Table1"."Column1", 3, 2)
Input
Table1
Column1 : STRING
'äöüo'
Output
Result
Column1 : STRING
'o'


  • No labels