Tableau 2
Tableau 2
• On clicking the Microsoft Excel option, a dialogue box will appear for the
user to choose the required data file. As shown below I have chosen a data –
‘Coral data.xlsx’
• Now, Tableau will create connection to the data file and as you can see we
have our data at the bottom.
• If you are connecting to a Microsoft file then it is straight forward but if you
are connecting to a Microsoft SQL server then there is a possibility that it
might need some credentials like username, password e.t.c
• After connecting to the data file, the user can go the Worksheet.
• Then finally you can work on the data visualisation after wrangling your
data.
Import Excel file in Tableau
Tableau
Tableau is a very powerful data visualization tool that can be used by data
analysts, scientists, statisticians, etc. to visualize the data and get a clear
opinion based on the data analysis. Tableau is very famous as it can take in
data and produce the required data visualization output in a very short time.
Excel sheets
Excel sheet is one of the most ubiquitous forms of files in the IT Industry.
Everyone who uses a computer at one time or the other have come across
and worked with Excel spreadsheets. This popularity of Excel is due to its
vast range of applications in the field of storing and manipulation of data in
a tabular and systematic form.
Dataset used in the given example is Dataset.
6. Here, you will get your dataset (Excel file content) with all sheets it
has.
7. You can view the data/sheet by dragging and dropping it and further
operations can be performed on it.
Data Cleaning in Tableau
To visualize data in Tableau, we need a data source file. Most of the times
the data file contains no straw value and can be used directly for the
visualization. But there can be situations that the data source is not formatted
and needs to be clean. So, this article aims to learn how to clean the data file
in Tableau.
Steps to follow:
• Open the Tableau and add data source file – YearlyData
• But there might be a problem in this data. The first indication of which can
be the displayed message saying that Data Interpreter might be able to clean
my Excel workbook.
• Till now it is not clear what the actual problem is, so let’s load the data
– Products sheet.
• It can be clearly seen that the data has a stray value of Year2016 above it
where ProductID, the ProductName, and the ProductCategory is also
• To clean up the data, go over to the sheets section of the left-hand pane and
check Use Data Interpreter. This will clean the data, Year2016 value is gone,
and the data has ProductID, ProductName, ProductCategory, and
Price appearing as it’s supposed to be.
• Go to the Sheet, under dimensions, it
has ProductCategory and ProductName, and under Measures, the data
has Price and ProductID.
• ProductID is actually a dimension rather than a measure, so hover the mouse
pointer over ProductID, click its down-arrow, and then click Convert to
Dimension.
• Now, ProductID is a searchable and sort-able value that can be used here.
• If the data source is too complicated, the Data Interpreter might not be able
to help but if a single stray value, or perhaps some irregular formatting is
present within your data, then using the Data Interpreter is a great way to
solve that problem
Tableau – Join databases
Designing good data has a fundamental principle of spreading the data out
so that each data table stores the information about a particular business
entity.
Let’s suppose that the model has a set of restaurants which are located in
different cities. Each of these restaurants could have a restaurant ID, the
restaurant city and the restaurant state. Another table has a list of workers for
the entire restaurant chain with a field indicating which restaurant they are
working at. So it is possible to link these two tables based on the common
data attribute or field of restaurant ID (in this case).
This article aims to explain the principle of creating a connection between
related data with the data source in Tableau.
Steps to perform:
• In the Tableau, connect to the databases.
• The data source has three data files – Product, OrderDetails, PropertyInfo.
These are three different excel sheet present in one data file.
• Open Product data file.
• Add OrderDetails data file, it contains the information about each order.
• Now you can see there is a join in the two data files.
• If you’ll hover on the join then you can see that there is a inner join using the
common key i.e. Product ID. Inner join simply means that there are two files
have a field in common and it can be combined easily.
• Next, add the PropertyInfo file and it can be see that it is also joined.
Designing good data has a fundamental principle of spreading the data out
so that each data table stores the information about a particular business
entity.
Let’s suppose that the model has a set of restaurants which are located in
different cities. Each of these restaurants could have a restaurant ID, the
restaurant city and the restaurant state. Another table has a list of workers for
the entire restaurant chain with a field indicating which restaurant they are
working at. So it is possible to link these two tables based on the common
data attribute or field of restaurant ID (in this case).
But sometimes there can be a case that the field in common is having the
inconsistent naming and then the data sources will not join automatically.
This article aims to explain how to deal with this situation.
Steps to perform:
• In the Tableau, connect to the databases.
• The data source has three data files – Product, OrderDetails, PropertyInfo.
These are three different excel sheet present in one data file.
• Open Product data file.
• Add OrderDetails data file, it contains the information about each order.
• But now it can be clearly seen that the Tableau indicates that it can not find a
match in the field names.
• Actually, there is a data field with exactly the same data in both the data
sources. So that means that we can create an inner join for the two data
sources.
• Click Product ID, and then, over-under OrderDetails hover my mouse
pointer over the field.
• Click the down arrow, and from here click Prod ID, which is just a shortened
form of Product ID
• Close the dialogue box and now you can notice the data is perfectly joined.
• Similarly you can join as many data sources you want and now the data is
completely ready for the visualization.
• Again, go to Data
• Select Replace Data Source
• A dialog box will appear, first enter the name of the data source to be
replaced then enter the name of the data source to be replaced with.
• Press OK
After the replacement you may notice a red exclamation mark in front of
some fields, this is the indication that these fields have no meaning or value
for second data source.
Tableau – Split the text to columns
• When you will click the split option, Tableau splits the data based on the
colon that you have in the middle, so it recognized it as a separator and now
you have Product Combined and then Product Combined split 1 and Product
Combined split 2.
• Add OrderDetails data file, it contains the information about each order.
• Now you can see there is a join in the two data files.
• If you’ll hover on the join then you can see that there is a inner join using the
common key i.e. Product ID. Inner join simply means that there are two files
have a field in common and it can be combined easily.
• Next, add the PropertyInfo file and it can be see that it is also joined.
• Now, go to the Data menu. Go down to the bottom of the menu and click the
last item. And the specific item that appears here will depend on the name of
the data source.
• Then from the submenu that appears, click view data. Doing so displays the
data. You can see up to 5000 rows or if you want to see more you can edit
the value in the box. And also because there are more columns you can
either expand this window by dragging it to the side or drag the horizontal
slider.
• This data source combines data from several different tables. So you have
my order date and order ID here and then if I go over I’ll see property ID,
property state and so on. Even though you have those data points, or those
values, in different tables within the source excel file.
• To copy any data, drag across the data and once it’s selected you can click
copy and select those values. When you’re done you can click the close box
to close that window. Looking at the data behind the visualization can be
very helpful.
Tableau – Adding, Renaming and duplicating
worksheets
• Add OrderDetails data file, it contains the information about each order.
• Now you can see there is a join in the two data files.
• If you’ll hover on the join then you can see that there is a inner join using the
common key i.e. Product ID. Inner join simply means that there are two files
have a field in common and it can be combined easily.
• Next, add the PropertyInfo file and it can be see that it is also joined.
• To add: you can see near to the sheet option you have add new worksheet
option an using that you can add more sheets.
• To duplicate:Go the sheet option and then select duplicate option, this will
mimmic the same task of the original worksheet.
• To rename any worksheet, again to the option and select the Rename option
and you can change the name of the options.