Program 2
Program 2
To learn and understand about connecting to data, data aggregations and different
types of joins.
Connecting to Data and preparing data for visualization in Tableau
Tableau supports connecting to a wide variety of data, stored in a variety of places. For
example, data might be stored on computer in a spread sheet or a text file, or in a big
data, relational, or cube (multidimensional) database on a server in enterprise or the data
can be from a public domain available on the web.
Data can be imported in Tableau Public from Connect panel on left side. For example, an
Excel sample data set was loaded into Tableau as follows:
Now drag Returns table onto the Canvas to the right of Orders table. This shows the
relation between the two tables Orders and Returns. This step creates a data extract
which improves query performance.
Data aggregation and statistical functions
We can apply various aggregation and statistical functions on data such as count,
minimum, maximum, standard deviation, variance etc. This is shown below. This can be
done by right clicking on the required field of dataset, click on Default properties and click
on aggregation.
Or the above operation can be done by creating a calculated field as shown below. To
create a calculated field, click on the down arrow button beside search tab above Tables
panel, drag a field to that calculated field window.
Then click on apply and results are shown below:
In the same way we can apply any aggregate or statistical function on data with the help
of calculated fields.
Types of Joins:
In Tableau, joins are used to combine data from multiple tables based on a related column.
Here are the main types of joins you can use in Tableau:
1. Inner Join:
o Combines rows from both tables where there is a match in the join condition.
o Only includes records that have matching values in both tables.
2. Left Join (Left Outer Join):
o Includes all rows from the left table and matched rows from the right table.
o If there is no match, the result will contain NULLs for columns from the right
table.
3. Right Join (Right Outer Join):
o Includes all rows from the right table and matched rows from the left table.
o If there is no match, the result will contain NULLs for columns from the left
table.
4. Full Outer Join:
o Combines rows from both tables and includes all records, regardless of
whether there is a match.
o If there is no match, the result will contain NULLs for the non-matching
columns.
Select the Excel file and drag the sheet then right click and click open. It will create the joins.
Drag and drop the next sheet. It will show the joins.
Right Join:
Full Outer Join: