TO_DOUBLE
Description
TO_DOUBLE
is a row function that converts Text
,
Boolean
, Integer
, Long
, or
Double
values to Double
(a type of numeric)
values.Syntax
TO_DOUBLE
(expression
)Return Value
Returns one value per row of type
Double
.Input Parameters
- expression
- Required. A field or expression of typeText(must be numeric characters),Boolean,Integer,Long, orDouble.
Examples
Convert the values of the
average_rating
field to a Double field type:TO_DOUBLE([average_rating])
Convert the
average_rating
field to a Double field type, but first transform the
occurrence of any NA
values to NULL
values using a CASE
expression:TO_DOUBLE(CASE WHEN [average_rating]="N/A" then NULL ELSE [average_rating]
END)