Skip to main content
Workday User Guide
Last Updated: 2023-06-23
TO_INT

TO_INT

Description

TO_INT
is a row function that converts
TEXT
,
BOOLEAN
,
INTEGER
,
LONG
, or
DOUBLE
values to
INTEGER
(whole number) values. When converting
DOUBLE
values, everything after the decimal will be truncated (not rounded up or down).

Syntax

TO_INT
(
expression
)

Return Value

Returns one value per row of type
INTEGER
.

Input Parameters

expression
Required. A field or expression of type
TEXT
,
BOOLEAN
,
INTEGER
,
LONG
, or
DOUBLE
. If a
TEXT
field contains non-numeric characters, the function returns NULL.

Examples

Convert the values of the
average_rating
field to an Integer field type:
TO_INT([average_rating])
Convert the
flight_duration
field to an Integer field type, but first transform the occurrence of any
NA
values to NULL values using a
CASE
expression:
TO_INT(CASE WHEN [flight_duration]="N/A" then NULL ELSE [flight_duration] END)