Tableau Tutorial – Data types in Tableau




Every analytics tool has it’s own way define the data types in accepts. Its not to say that these conceptually different, but they are modified to suit the tasks performed by the tool. In this post of ‘Tableau Tutorials’ series, we will discuss the data types in Tableau. So let’s take a close look at the data types used in the Tableau. Just like, MS Excel, Audit Command Language, SAS etc, data types are divided up into four categories. These are string, numbers, dates & geographical locations. The difference lies in how these are used in Tableau. For instance, dates are not required to be formatted to be imported into Tableau. A character field in a text file, which has a date format is read as date regardless of the format i.e. the dd/mm/yyyy. This is true for other fields as well.

Essentially, since tableau is not designed to perform heavy data transformations, it is not as picky about the data formats of the fields in data files. The end goal is to be able to perform new calculations and create graphs and charts. The design philosophy indicates that Tableau has taken away the features of data formatting from MS EXCEL and focused that computing power to perform real time calculations and creation of visualizations. Let us quickly review the data types in Tableau:

  1. Strings – All character values such names, IDs, description fields etc. are tagged under this data type.
  2. Numbers – Any fields, which can used to provide quantitative values to visualizations are considered numbers. Fields such as sales, profit values, discounts etc. can all be assumed as numbers.
  3. Dates – Any date values in a data set should ideally be classified as dates type because Tableau provides specific functions and visualizations to deal with date values.
  4. Geographical locations: This is a data type unique to Tableau. Essentially, Tableau has the capability to extract the geo-location of cities listed within the data files. This allows users to create the iconic visualizations using world maps.

Consider the screenshot below to understand, where in the interface can users make changes to data types information:

This screenshot shows the top rows of the bottom pane. At the top of this pane, the different types are listed along with the field. The column for profit is listed as ‘number’, ship date is listed as ‘date’, postal code is listed as ‘geographical’ and region is listed as ‘String’. If we click on the data type indicator i.e. for example the globe symbol on column ‘city’, it gives us options for different data types. See screenshot below;

In the screenshot, we are trying to change the data type for ‘Region’ from string to ‘Number’. This is clearly problematic. See screenshot for result of this change:

When we change the data type for ‘Region’ to number from string, it gives us null values. This is expected as it makes no sense to have the number type for this field. This is not true for every case. There are fields that can be mapped as multiple data types. However, Tableau itself selects the best option.

You can find relevant reference books in the sidebar, if you should want to purchase the same for further studying. Please sign up for our newsletter, so that we may keep you posted on the latest activity on our website and Youtube channel.