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):
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.
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.
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?
- 1000
- 5000
- 100
- 10000
Solution: 100
Can we change the geographical role of a dimension?
- True
- False
Solution: True
When using the manage metadata option, when we change the name of a field, it is referred toΒ as?
- Field Name
- Remote FieldΒ Name
- Name
- 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?
- True
- False
Solution: True
Dimensions containing _____ and ______ values canβt be continuous. [Multiple Choice Questions](Choose 2)
- Boolean
- Date
- Date andΒ Time
- String
Solution: Boolean andΒ String
Choose the way in which we can change our dataΒ type.
- Not possible toΒ change
- From dataΒ source
- From dataΒ pane
- 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):
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:
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