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

TO_LONG

Description

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

Syntax

TO_LONG
(
expression
)

Return Value

Returns one value per row of type
LONG
.

Input Parameters

expression
Required. A field or expression of type
TEXT
(must be numeric characters only, no period or comma),
BOOLEAN
,
INTEGER
,
LONG
,
DECIMAL
,
DATE
, or
DOUBLE
. When a
TEXT
field value includes a decimal, the function returns a NULL value.

Examples

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