Our terms of service are changing. Learn more.

Publication

Tutorial

Data Types in Tableau: Using & Cleaning; A Road to Tableau Desktop Specialist Certification

Last Updated on March 24, 2022 by Editorial Team

Author(s): Daksh Trehan

Originally published on Towards AI the World’s Leading AI and Technology News and Media Company. If you are building an AI-related product or service, we invite you to consider becoming an AI sponsor. At Towards AI, we help scale AI and technology startups. Let us help you unleash your technology to the masses.

Chapter 3: A deep dive into Tableau data types & metadata

Welcome to the third chapter, In this piece, we are going to learn about accepted Data types in Tableau and how to clean them. In addition, we will have a look at metadata.

If you want to navigate through other chapters, visit: Tableau: What it is? Why it is the best?; A road to Tableau Desktop Specialist Certification.

If you want to directly go on Tableau Desktop Specialist notes, access them here → https://dakshtrehan.notion.site/Tableau-Notes-c13fceda97b94bda940edbf6751cf303

Use the link to get access to free Tableau certification dumps (Valid till 13 Apr 2022):

https://www.udemy.com/course/tableau-desktop-specialist-certification-dumps-2022/?couponCode=1FA58837A74561DC1EFB

When users connect to Tableau, the data fields in their data set are automatically assigned a role and a type.

A Role can be of the following two types:

1) Dimension

2) Measure

(More on Dimensions and Measure in later chapters)

Type can be of the following :

1) String

2) Number

3) Geographic

4) Boolean

5) Date

6) Date and Time

Table of Content:

  • Data Types in Tableau
  • Exploring Metadata
  • Modifying Metadata
  • Changing Data Type
    – Changing data type in the source page
    – Changing data type from the data pane
    – Changing data type in the view
  • Handling Mixed Data Types
  • Sample Exam questions from this topic

Data Types in Tableau

Data is the fuel powering Tableau and every field in our dataset constitutes data that belongs to a generic data type. The data type helps the software to understand the kind of data stored in that field.

Tableau supports 7 data types. As soon as new data is uploaded, Tableau automatically detects the data type and assigns it to the fields. The data type can also be modified manually once the data is uploaded.

Data Type supported by Tableau, Source

String → The “string” data type constitutes zero or more characters enclosed in single or double quotes.

e.g. “Tableau is a BI tool” or ‘Tableau is a BI tool’.

The string data type can be classified in:

  • Char: In char data type, the value of a string is of fixed length. If we try to load a value of a length greater than the specified length, Tableau throws an error. This data type is used to store alphanumeric data values.
  • Varchar: Varchar stands for Variable char, the length of characters is flexible here and has no memory allocation restrictions.

Date & Time Values → This data type is used to store dates and times. Tableau can store dates in dd-mm-yy, dd-mm-yyyy, mm-dd-yyyy format.

Some fields only include the date and hence can be stored in date data types. Some fields that store both date and time (more like a timestamp) can be stored in date & time data type.

The time value can be a decade, year, quarter, month, day, hour, minute, second, etc.

If you wish to enter a date in “string” format use “#” before the date. e.g. #14–01–2022 and it will be stored in string format.

Numerical Values → This data type can contain either float or integer data points. We can also perform manual calculations over them to get a deeper insight into our data.

Boolean Values → This data is the result of relational calculations and can only contain two values: True or False.

Geographic Values → This data type is represented by the globe and contains the data that can be used in maps. This includes Latitude, Longitude, Country, Cities, Region, Postal Codes, etc.

We can convert textual fields to geographic data

We can change the geographical role of a dimension.

There are two Maps available — Symbol Map and Filled Map.

The geographic region data type is also a string.

Cluster Groups → Sometimes the data is too rough and represents mixed data types, this is the type of data that is stored in Cluster groups.

Such kind of data can be handled either manually by segregating fields or letting Tableau do its wonders.

Exploring Metadata

In Tableau, when we connect data to the Start page, we get a data preview where we can check out metadata for each column.

By default, we can peek at only 1000 rows.

To explore more about Metadata, click on “Manage Metadata: →

We can get Metadata in the following orders →

The metadata contains “Field name”, “Data Type”, “Table Name” and “Remote Field Name”. The metadata is automatically identified by Tableau and can be further modified manually.

When using the manage metadata option, when we change the name of a field, it is referred to as “Field name” which was previously referred to as “Remote Field Name

Modifying Metadata

We can perform the following operations on fields using the “Managed Metadata” option →

Tableau can further define its decision(on how it chose which data type this field has) and more about that field.

Changing Data Types

Tableau automatically defines a data type for each field, but we can also manually challenge its decisions and change the data type for each field.

This can be done in three ways:

Changing Data type in the source page →

To change the data type on the source page, go to the preview menu, click on the data type specified for each field, and choose the new data type.

Changing Data type from Data Pane →

The data type can also be changed from the data pane, click on the data type specified for each field, and switch to a new data type.

Changing Data type in the View →

To change the data type in the view, right-click on the field, go to “Change Data Type” and choose a new data type.

Handling Mixed Data Types

Sometimes, the columns contain a mix of data types. A column might constitute a mixture of date, date-time, strings, or blank spaces. When we try to connect the data file to Tableau, the mixed column is mapped to a single data type that infiltrates our data i.e. a column which is identified by Tableau as “Numerical data type” might also contain dates, strings, or blank spaces.

Tableau considers the top 10000 rows for an Excel File and 1024 rows for CSV files i.e. if we ingest an xlsx file that has 10000 rows and if most of them are of string, then Tableau will regard the whole column as a string.

When Tableau determines a data type for each field, and if the values don’t match that respective data type. Tableau tries to handle that field by adding ‘null’ values to those records that don’t match the specified data type.

Source

e.g. In a Boolean mapped column, if there are Text, Dates, or Numbers, those records will be treated as Null.

In Numbers mapped columns, if we get Text it will be treated as Null but if we get a date, it will be converted to the difference of that date from 1/1/1900.

Sample Exam questions from this Topic

By default how many rows does metadata shows?

  1. 1000
  2. 5000
  3. 100
  4. 10000

Solution: 100

Can we change the geographical role of a dimension?

  1. True
  2. False

Solution: True

When using the manage metadata option, when we change the name of a field, it is referred to as?

  1. Field Name
  2. Remote Field Name
  3. Name
  4. Field

Solution: Field Name

Explanation: When using the manage metadata option, when we change the name of a field, it is referred to as “Field name” which was previously referred to as “Remote Field Name”.

Can we convert textual data to geographic fields?

  1. True
  2. False

Solution: True

Dimensions containing _____ and ______ values can’t be continuous. [Multiple Choice Questions](Choose 2)

  1. Boolean
  2. Date
  3. Date and Time
  4. String

Solution: Boolean and String

Choose the way in which we can change our data type.

  1. Not possible to change
  2. From data source
  3. From data pane
  4. From the data source and data pane both

Solution: From Data Source & Data Pane both

Use the link to get access to free Tableau certification dumps (Valid till 13 Apr 2022):

https://www.udemy.com/course/tableau-desktop-specialist-certification-dumps-2022/?couponCode=1FA58837A74561DC1EFB

References:

[1] Tableau Help | Tableau Software

[2] Personal Notes

[3]Tableau Desktop Specialist Exam (New Pattern — 2021) — Apisero

Thanks for Reading!

Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me.

If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter:

Daksh Trehan’s Newsletter.

Find me on Web: www.dakshtrehan.com

Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan

Read my Tech blogs: www.dakshtrehan.medium.com

Connect with me at Instagram: www.instagram.com/_daksh_trehan

Want to learn more?

How is YouTube using AI to recommend videos?
Detecting COVID-19 Using Deep Learning
The Inescapable AI Algorithm: TikTok
GPT-3 Explained to a 5-year old.
Tinder+AI: A perfect Matchmaking?
An insider’s guide to Cartoonization using Machine Learning
How Google made “Hum to Search?”
One-line Magical code to perform EDA!
Give me 5-minutes, I’ll give you a DeepFake!

Cheers


Data Types in Tableau: Using & Cleaning; A Road to Tableau Desktop Specialist Certification was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

Join thousands of data leaders on the AI newsletter. It’s free, we don’t spam, and we never share your email address. Keep up to date with the latest work in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓