Tableau eLearning
Type Conversion Functions
Tableau Desktop Reference Guide
All fields in a data source have a data type, such as date, datetime, string, integer, or floating point number. You can use type conversion functions to convert
the result of any expression from one data type to another. This is useful in order to use the result in a calculation that requires a different data type as input.
Examples
These are some examples of he type conversion functions:
Function Syntax Purpose Example
DATE(expression) Returns a date when given a number, string, or DATE([Ship Date]) returns #November 15, 1998# if
date expression. [Ship Date] is a string with the value “November
DATETIME, MAKEDATE, MAKEDATETIME, and
15, 1998”.
MAKETIME are also similar
STR(expression) Returns a string from the given expression. STR([Age]) returns “17” if the value of [Age] is the
integer 17.
INT(expression) Returns an integer by truncating the given INT([Partial Order]) returns 1 if [Partial Order] is
expression. If the number given is negative, the 1.5.
function will return the integer closer to zero.
INT([Profit]) returns -2 if [Profit] is -2.8.
FLOAT(expression) Returns a floating point number from the given FLOAT([Age]) returns 17.000 if the value of [Age] is
expression. the integer 17.
TABLEAU.COM/ELEARNING