Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

Tableau Conversion Functions

by suresh

Tableau provides various Type Conversion Functions to perform typecasting on our data. They are Tableau DATE, DATETIME, DATEPARSE, INT, FLOAT, SRT, etc. In this article, we show how to use Tableau Conversion Functions with examples.

To demonstrate these Tableau Conversion Functions, we use the below Excel Worksheet. So, Please refer Connecting to the Excel Files article.

Tableau Conversion Functions 1

Tableau Conversion Functions

The following examples will show you the list of Conversion Functions in Tableau

Tableau STR Function

The Tableau STR function converts the given expression to a  string. The syntax of this Tableau STR Function is:

STR(expression)

To demonstrate these Tableau conversion functions, we have to use Calculated Fields. To create a calculated field, please navigate to Analysis Tab and select Create Calculated Field… option as shown below.

tableau convert date to string 2

Once you click on the Create Calculated Field… option, a window will be opened. Here, we renamed the default calculation name as STRFunc.

The below Tableau str statement will convert the Hire date to String

STR([Hire Date])
tableau convert date to string 3

Let me add this STR function field to an existing table (by dragging a field to Rows Shelf). Please refer Create Table Report article to understand the process of creating a table

tableau convert date to string 4

Tableau DATE Function

The Tableau Date function returns date from given expression, number, or string. The syntax of this Tableau Date Function is:

DATE(expression)

Let me use this Tableau date function on StrFunc, which holds Hire Date in string format.

DATE([STRFunc])
tableau convert string to date 5

From the below screenshot, you can see the Tableau Date function returned the date from the string column.

tableau convert string to date 6

Tableau DATETIME Function

The Tableau DateTime function is one of the Tableau conversion function, which returns date and time from a given expression, string, or number. The syntax of this Tableau Datetime Function is:

DATETIME(expression)

Let me use this Tableau DateTime function on StrFunc, which holds HireDate in string format.

DATETIME([STRFunc])
tableau convert string to date 7

Tableau INT Function

The Tableau INT function returns an integer from a given expression. The syntax of this Tableau INT Function is:

INT(expression)

Let me use this function on the Sales column, which holds Float values.

INT([Sales])
Tableau INT Function 8

Tableau FLOAT Function

The Tableau FLOAT is one of the Tableau conversion function which converts given expression to float. The syntax of the Tableau FLOAT Function is:

FLOAT(expression)

Let me use this Tableau float function on the income column, which has int values.

FLOAT([Income])
Tableau FLOAT Function 9

Tableau DATEPARSE Function

The Tableau Dateparse function parse and returns date and time from given expression, number, or string. The syntax of this Tableau Dateparse Function is:

DATEPARSE('format', expression)

Let me use this Tableau DateParse function on StrFunc, which has a string format of Hire Date. Remember, given format should match the data inside the column

DATEPARSE('yyyy-MM-dd h:m:s.SSSS', [STRFunc])
tableau convert string to date 10

Placed Under: Tableau

  • Download and Install Tableau
  • Tableau Start Page
  • Tableau Show Me
  • Connect to MS Analysis Services
  • Connecting Tableau to SQL
  • Tableau Connect to Text File
  • Tableau Connect to Excel File
  • Hierarchies in Tableau
  • Tableau Bins
  • Tableau Parameters
  • Combined Tableau Sets
  • Tableau Set
  • How to Edit Tableau Group
  • Tableau Group
  • Tableau Grouping
  • Tableau First Report
  • Data Labels in Tableau Reports
  • Format Tableau Chart Title
  • Create Folders in Tableau
  • Tableau Sort
  • Add Totals in Tableau
  • How to Join Data in Tableau
  • Tableau Data Blending
  • Tableau Table Report
  • Tableau Crosstab Report
  • Tableau Annotations
  • Tableau Charts
  • Tableau Area Chart
  • Tableau Bar chart
  • Tableau Box Plot
  • Tableau Bubble Chart
  • Tableau Bullet Graph
  • Tableau Bump Chart
  • Tableau Circle Views
  • Tableau Dual Combination Chart
  • Tableau Dual Lines Chart
  • Tableau Funnel Chart
  • Tableau Traditional Funnel Chart
  • Tableau Gantt Chart
  • Tableau Grouped Bar Chart
  • Tableau Heat Map
  • Tableau Highlight Table
  • Tableau Histogram
  • Tableau Cumulative Histogram
  • Tableau Line Chart
  • Tableau Lollipop Chart
  • Tableau Pareto Chart
  • Tableau Pie Chart
  • Tableau Scatter Plot
  • Tableau Stacked Bar Chart
  • Tableau Text Label
  • Tableau Treemap
  • Tableau Word Cloud
  • Tableau Waterfall Chart
  • Tableau Individual Axis
  • Tableau Dual Axis
  • Tableau Blended Axis
  • Tableau Add Reference Lines
  • Tableau Add Reference Bands
  • Add Reference Distributions
  • Tableau Maps
  • How to Create a Map in Tableau
  • Use Google Maps in Tableau
  • Mapbox Maps as a Background
  • WMS Server Map as Background
  • Create a Tableau Dashboard
  • Format Dashboard Layout
  • Create Dashboard Device Prev
  • Tableau Dashboard Objects
  • Create a Tableau Story
  • Tableau Filters
  • Tableau Filters on Dimensions
  • Tableau Filters on Measures
  • Tableau Extract Filters
  • Tableau Dashboard Filters
  • Tableau Data Source Filters
  • Tableau Slicing Filters
  • Tableau Quick Filters
  • Tableau Context Filters
  • Tableau Top Filters
  • Tableau Table Calculations
  • Tableau Calculated Fields
  • Tableau Running Total
  • Tableau Rank Calculation Basic
  • Tableau Rank advanced calculate
  • Tableau Aggregate Functions
  • Tableau Conversion Functions
  • Tableau Case Function
  • Tableau Date Functions
  • Tableau If Function
  • Tableau Logical Functions
  • Tableau Math Functions
  • Tableau String Functions
  • Tableau Table Functions

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy