Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Assignment 4 – Creating Animation in Tableau

Student Name:

Student ID:

Date:

Note:

 Take all the screenshots uncropped i.e. date and time should be visible in your screenshots.
 You need to submit your answers in a separate word document. No need to write the
questions in it. Put the question number and your solution. Do not provide the screenshots of
intermediate steps.
 There will be deductions for providing more than what is asked.

The objective of this exercise is to use learn how to blend data and create animation in Tableau.

Step 1:

Download datasets from eLearning. There are four datasets. Each contains different information about
the countries of the world from 1960 to 2013. Country-Metadata contains the information of the region
of the country. Country-Population contains the population of these countries, Country-Fertility-Rate
contains number of children per family in a given year and Country-Life-Expectancy-At-Birth has the
number of years a child is expected to live at the time of his/her birth.

We will import these four sheets in Tableau.

Click on Microsoft Excel and import the sheets one by one.

After importing the datasets, go to worksheet by clicking the tab named Sheet 1.
In the Data pane, you can see four data connections as shown in the below screenshot.

Also, look at the measures. You will find that each individual year is categorised as measure. If you look
at the dataset, you can find that the header of the column is the year in which the data is recorded. The
way data is stored in excel is human readable. But it is not good for creating visualization. (Try it
yourself: Try to create a line chart showing the growth of population of any country of your choice from
1960 to 2013. In the current format of data, it will not be possible.)

We need to convert the data in such a way that one column has year and the other column has
population/ life expectancy/fertility. For this we will use pivot option available in tableau.

Select the dataset Country-Population from the data pane.

Now go to Data Source window

Select all the columns from 1960 to 2013 and click on the small triangle. Click on Pivot.
You will find that two new columns are created.

We will change the names of these columns.

Change Pivot Field Names to Year and Pivot Field Values to Population.

Do the same for other two sheets except Countries-Metadata.

1. Paste the screenshot of Data Source tab of Country-Population.

Step 2:

Now we will blend the data. (Note: Whatever we are doing in this exercise using blending, can be done
by joining these data sources. But as our aim here is to learn blending, we will not use joins.)

Click on Data in the Menu Bar and select Edit Relationships.


A relationships window will open. It will have one data source as primary data source and others as
secondary. If you want, you can change the primary and secondary data sources. We will keep it as it is.
The primary data source is Country-Population. In the relationship window you will find that Tableau has
created relationships based on common fields of the datasets. We don’t want to use all these fields, as
they hold different data in different datasets. The only common field is Country Code and Year. Country
name can also be same in all the data sources, but we will not use it as the names of country can have ‘-‘
in between in different datasets and this will cause problem while blending.

In the secondary data source window, click on Country-Fertility-Rate and select Custom.
Now, remove all the relationships, except Country Code and Year.

Repeat the same for Country-Life-Expectancy. For Country-Metadata, we will have only Country Code as
relationship.

Click OK.

Now, on Sheet 1, drag Population to Size in the Marks pane.

You will see that as soon as you drag Population to Size, a blue tick mark will appear on the dataset
Country-Population.
This shows that the data source is considered as primary data source. Now click on data source Country-
Fertility-Rate. You will find two greyed out crossed links on dimensions Country code and Year. This
indicates that these two fields can be used to link this data source to Country-Population data source.
But we need to make them active.

To make the links active, just click on the link icon. It will turn orange. And the data source Country-
Fertility-Rate will have a orange tick mark. This indicates that it is secondary data source.

Similarly, activate the links for other two data sources.


Now from Country-Fertility-rate data source we will drag Fertility Rate to column and from the data
source Country-Life-Expectancy, we will drag Life Expectancy to rows.

From Countries-Metadata, drag Region to Color.

Now, click on shapes, and select the filled circle.

Now, drag Country Names to details.

Click on Size in the Marks Pane and increase the size.


You can also change the size by clicking on the Population Card and selecting Edit size.

Let’s do this. Select on Edit sizes… as shown n the above screenshot and select Size vary: by Range.
Reduce the range from the left side as shown in the screenshot.

Click Apply and then OK.


Now go to Color Mark and reduce the Opacity to 75%.

Go to analysis and uncheck Aggregate Measures.

Now, drag Year to Pages.

You will see that a new card has popped up.

This card controls your animation. The three small buttons with bars show the speed of play of
animation.

When you put Year to Pages, a page is created for each year and when you play the animation, these
will be displayed one by one.

There are a few null values. We don’t need that indicator. Right click on it and hide it.
Now right-click on your sheet. In the drop down window, select Annotate and then Area.

In the Edit Annotation window, click on Insert and select Page Name.
Change the font to 48, click Bold and select Color as shown.

Click OK.

Right click on the border and select Format.


Select the box as None in the format pane.

2. Paste the screenshot of your sheet.

3. Record your animation using any screen-capturing software and submit is in mp4 format.

Step 3:

Now go to the animation play card and select show history check box.

Now, on the sheet, select Nigeria and play the animation.


You will find that the animation will show all the data points for Nigeria from 1960 to 2013.

4. Paste the screenshot of your sheet.

When you click on the small triangle for Show History, you will have a number of options.

You are encouraged to go ahead and play with these.

Deliverables:

1. Your solutions in a word document.


2. Your tableau file in twbx format.
3. Your animation in mp4 format.

You might also like