TO_CURRENCY
Description
TO_CURRENCY
is a row function that converts TEXT
values that contain valid currency-formatted data to CURRENCY
values.Syntax
TO_CURRENCY
(expression
)Return Value
Returns a value of type
CURRENCY
.Input Parameters
- expression
- Required. A field or expression of typeTEXTthat represents a valid currency-formatted value.A valid currency-formatted value meets these requirements:
- Includes both the numeric value and currency code.
- Uses a period to separate digits before and after the decimal.
- Doesn't include any character to separate the thousands place.
Example:10000 EURand12345.678 USD.
Examples
Convert this text value to a Currency field type:
TO_CURRENCY("1234.56 USD")
Convert the values of the Grant Price field to a Currency field type using the currency codes in the Grant Code field:
TO_CURRENCY(CONCAT(TO_STRING([Grant Price]), [Grant Code]))
Convert the Sale Price field Text field to a Currency field, but first transform the occurrence of any N/A values to NULL values using a
CASE
expression:TO_CURRENCY(CASE WHEN [Sale Price]="N/A" then NULL ELSE [Sale Price] END)