Skip to main content

PQL46 (PQL Function Library - CPM 4.6)

STR_TO_INT

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

Description

STR_TO_INT converts the input strings to integers. If the input is not a number (or outside of the supported range), null is returned. If the input is a float, the decimal places are ignored.

Supported input column types: STRING

Output column type: INT

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

Syntax
STR_TO_INT ( table.column ) 
Example

[1] Convert strings to integers. The numbers 9223372036854775908 and -9223372036854775809 are outside of the supported range.

Query

Column1

STR_TO_INT ( "Table1"."Column1" )

Input

Output

Table1

Column1 : STRING

null

''

'123456'

'-123456.11'

'123456.11'

'123456.99'

'12345699'

'4.70E+2'

'-5.93E-2'

'9223372036854775807'

'-9223372036854775808'

'9223372036854775908'

'-9223372036854775809'

Result

Column1 : INT

null

null

123456

-123456

123456

123456

12345699

null

null

9223372036854775807

-9223372036854775808

null

null