Skip to main content

PQL47 (PQL Function Library - CPM 4.7)

TO_INT

Applies to: CELONIS 4.7

Description

TO_INT converts STRING input to INT output. If the input does not represent an integer number (or the value of the representation is outside of the supported INT range), NULL is returned.

Supported input column type: STRING. Use of the decimal separator or scientific E notation in input strings is not supported in TO_INT, and will be mapped to NULL.

Output column type: INT.

Syntax
TO_INT ( table.column ) 
Null handling

If the input value is NULL, the output value is NULL as well.

Example

[1] Convert strings to integers. Note the NULL output for the following STRING input:

  • NULL

  • The empty string

  • Use of decimal separator

  • Scientific E notation. Example: 4.70E+2

  • Values outside the range for INT

Query

Column1

TO_INT ( "Table1"."Column1" )

Input

Output

Table1

Column1 : STRING

null

"

'123456'

'-123456'

'1.11'

'-9.99'

'12345699'

'4E2'

'-5.93E-2'

'9223372036854775807'

'-9223372036854775808'

'9223372036854775908'

'-9223372036854775809'

Result

Column1 : INT

null

null

123456

-123456

null

null

12345699

null

null

9223372036854775807

-9223372036854775807

null

null

See also: