Type Conversion
There are functions in Tableau to convert any field or value to another data type as long as it can be configured sufficiently. Dates and spatial fields can also be created from scratch.
In the order example data source, a type conversion function used could be the STR
function, which would convert a numeric ID field into a string, as technically, IDs should not be treated as numeric values.
Data Types
For every data type in Tableau, there is a calculated field function to convert from one type to another.
The STR
function converts a value to a string data type. It is formatted as STR(value)
and outputs the input value as a string. This is often useful for ID fields, which may be read in by Tableau as a numeric data type. An example would be an ID field with numeric values such as 10001
being formatted as STR([ID])
, resulting in the ID being cast as strings, 10001
.
The INT
and FLOAT
functions are similar to the STR
function, but instead convert values...