Tableau Data Types

Tableau is a business intelligence and data analysis tool, data is the main thing we are always dealing with it. Data is an important functional element in Tableau. It is also important for us to learn and understand the different data types used in Tableau.

A data type is a classification that specifies which type of value a variable has and what type of mathematical, relational, or logical operations can be applied to it without causing an error.

The data type categories the data value into its definite types:

  • Some of the data values contain only text in them, so their data type will become a String.
    Ex: "CherCherTech"
  • Some of the data values contain only numbers in them, so their data type will become an Integer.
    Ex: 2020
  • Some of the data values contain data in the form of date and time, so their data type will become a date/time data type.
    Ex: 22/02/2019 or 03:25:40

In a similar way, every data value will fall under a certain category of the data type. Tableau also has a set of data types based on which, it characterizes every data value present in it as field values either from a live data connection or as a data extract from the data source.

You can use around seven data types in Tableau. Tableau automatically detects the data types of various fields as soon as new data gets uploaded from the source to Tableau and assigns it to the fields. You can also modify these data types after uploading your data into Tableau.

String Data Type in Tableau:

A string is a data type that contains zero or more characteristics in the text format, and the value will be considered as a string when it is encoded in single or double-quotes are called string data types.
Ex: "Apple", 'Orange'.

The String Data type is further divided into two categories:

Char String Type :

The value of the Char string data type has a fixed length and the memory corresponding to this fixed length is allocated to the char string type values in Tableau.

If you try to enter a string value greater than the fixed length then the system will throw an error. Char string data types usually store alphanumeric data values.

Ex: String[5]= "NUM11"

Varchar String Type:

Varchar string type stands for variable character length where the length of the characters to be entered in a string is not fixed or predefined.

Here, you can enter as many characters as you want without having any memory allocation restrictions, this type of string also can have alphanumeric data values.

Ex: String[]= "CherCher"

Numeric Data Type in Tableau:

If a data value present in the data type contains only numbers in them, then this kind of data type is called numeric data types, the data values can be either an integer type or floating type.

Most fields having numeric data types are integer types. Even if floats are used, then they are often rounded up to integer by using the Round function.

Ex: A=222, N=455.00=455

Date and Time Data Type in Tableau:

The data value present in the data type contains data in the date and time format then the data type is called a date-time data type.

In Tableau, you can use almost all the formats of date and time such as dd-mm-yy, dd-mm-yyyy, or mm-dd-yyyy, etc. Some fields can only contain a date value or a date can exist along with the time.

The time data values can be a decade, year, quarter, month, day, hour, minutes, seconds, etc., if you wish to add a date value in the form of string characters, add a # sign before it.

Ex: #20 January 2020

Boolean Data Type in Tableau:

The boolean data type values are a result of relational calculations. Therefore, True and False boolean values are known as logical values. Sometimes, the result of a relational calculation is unknown and obscure. Such values are shown as Null values.

Ex: If A=4 and B=8, A>B=False.

Geographic Data Type in Tableau:

The geographic data types are the data values that are used in a map. Values such as country name, state name, city, region, postal codes, etc. belong to the geographic data type. The fields of this data type are denoted by a globe icon.

Cluster or Mixed Data type in Tableau:

Tableau, sometimes might not contain a single data type, instead, it contains a mixture of data types, which is called a cluster or mixed data types. In such scenarios, either you can manually handle such fields by segregating values belonging to different data types into the column or you can let Tableau handle it.

Tableau Metadata

Changing Data type in Tableau

Tableau detects and assigns respective data types to all the existing fields in a data set during fresh data upload. However, you can make changes in the data types at many stages while working with Tableau. Three of which are shown below:

Changing data type of a field on Data Source page:

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls file from the link: https://chercher.tech/files/
  • Once the data source has been connected, drag any of the sheets to the Tableau workspace as below.
    drag-order-sheet-to-workspace-tableau
  • The Sample Superstore excel file contains the below details, which are displayed in the Tableau workspace.
    fields-displaying-in-tableau-workspace
  • To change the data type of a field from the Data Source page, click on the data type icon of that field.
  • A drop-down list will appear as below, you can select a new data type and assign it to the values of that field.
    clicl-on-data-type-icon-and-select-data-type-tableau
  • In the below image, the ship date is by default has been set to the Date data type.
    changing-shipdate-data-type-tableau
  • Here, I am changing the Date data type to date and time data type, the result table is as below.
    data-type-changed-to-date-and-time-tableau

Field Operations in Tableau

Changing data type of a field from Data pane In Tableau

Once the data source gets uploaded in Tableau, the basic data fields are shown in the Data pane of a Tableau worksheet. We can also change the data type of a field from here.

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigated to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls file from the link: https://chercher.tech/files/
  • Once the data source has been connected, drag any of the sheets to the Tableau workspace as below.
    drag-order-sheet-to-workspace-tableau
  • The fields are displayed in the Tableau as below.
    data-fields-in-tableau-workspace-tableau
  • Click on the data type icon of a field, you can see the list of data types in the dropdown. You can see that the Customer ID is set to String data type by default.
    data-type-drop-down-list-tableau
  • Select a new data type for the values of that field from the list that opens. I have set the data type of Customer ID to Number(Whole).
    customer-id-set-to-number-tableau

Installation of Tableau

Changing the data type of a field in the View in Tableau

Another way to change the default data type of a field is from the view.

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Next, the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • The Sample Superstore.xls excel file contains the below details.
    sample-superstore-excel-file-tableau
  • Once the data source gets uploaded in Tableau, the basic data fields are shown in the Data pane of a Tableau worksheet.
    data-fields-in-tableau-workspace-tableau
  • Right-click on the field and then select Change Data Type from the drop-down list.
  • This will further open a list of data types from where you can select the data type of your choice as shown in the image below.
    data-types-drop-down-list-tableau
0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions