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 typeText(must be numeric characters only, no period or comma),Boolean,Integer,Long,Decimal,Date, orDouble. When aTextfield 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)