Skip to main content

Type Conversion Functions (Locked)

Explicit datatype coercion. Row-level.

Numeric​

FunctionSignatureReturnNotes
INTINT(expression)IntegerTruncates decimals (not rounds).
FLOATFLOAT(expression)NumberConverts to floating point.

String​

FunctionSignatureReturnNotes
STRSTR(expression)StringConverts any expression to string.

Date​

FunctionSignatureReturnNotes
DATEDATE(expression)DateCoerces string, datetime, or number to Date.
DATETIMEDATETIME(expression)DatetimeCoerces to Datetime.

Boolean​

FunctionSignatureReturnNotes
BOOLBOOL(expression)BooleanCoerces to Boolean. Note: string 'true'/'false' → Boolean; number 0 → FALSE, nonzero → TRUE.

Common Patterns​

  • Convert a stringified number for math: FLOAT([Numeric String]).
  • Format a number as a display string: STR([Sales]).
  • Coerce a date-looking string to Date: DATE([Date String]), but prefer DATEPARSE for non-standard formats.
  • Ensure Boolean interpretation: BOOL([Flag Field]).

Common Anti-Patterns​

  • INT vs ROUND: INT truncates, doesn't round. INT(2.7) = 2, not 3. Use ROUND for rounding.
  • STR without format control: for currency/percent display, use tooltip formatting or a display-string calc instead.
  • DATE on a datetime loses the time portion. Confirm intent before dropping precision.
  • Bare BOOL() on an untrusted string; validate first with ISNULL or a value check.

R-TYPE-02 Return Type Discipline​

If the ask specifies a return type ("give me a Boolean"), the outer function of the calc must return that type. Type conversion at the outermost position is the escape hatch for calcs that need to change their natural type.

Version Notes​

All type conversion functions available Desktop 2020.1+.