Assignment 1 Charts in Tableau
Assignment 1 Charts 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.
There are 17 questions carrying 0.1 marks each and 0.3 marks for the tableau file in correct
format (twbx file format).
The objective of this exercise is to use learn how to create basic charts in Tableau and to know when to
use a particular chart, how using a chart makes the understanding of underlying data easy. The data is
for purchase orders from a store between Dec 2014 and June 2015.
Step 1:
To import the data, you need to click on Microsoft Excel on the home screen of Tableau and
select the file to be imported.
Under “Sheets” you will find the names of two sheets. If you look at your dataset in excel, you will find
those two sheets there. Now you can choose the sheet on which you want to create visualization. You
can choose both the sheets too. If you select both the sheets, a join will be created based on the
columns in the sheets.
For this exercise, we will choose only ‘Orders’ sheet. To select this sheet, drag it to the area
labelled with text “Drag tables here”.
Click on Sheet 1 in bottom left corner.
There are two columns in the data set – “Product Category” and “Product Sub-Category”. Here we
would be visualizing which product sub-category has the highest number of sales under a particular
product category. The best way to visualize this would be using a bar chart.
Before creating a bar graph, we will be adding a column named “Number of Records” to the “Measure
Names”. Since that column is not present in the dataset.
For this, right click under Meaure Names and click on “Create calculated field” or “Create” ->
“Calculated field” as shown in screenshot
In the opened box, write 1 and click apply and OK, “number of records” will be created.
Drag “product category” and “product sub-category” to rows and “number of records” to
columns. The default level of aggregation for number of records is “SUM” and hence you will see
the word SUM when you drag it to columns.
After dragging “number of records” to column, you will see that a horizontal bar chart is prepared for
you. If you like to change the axis you need to click on in the tool bar. It will change the bar
chart from horizontal to vertical and vice versa. For our exercise, we will go with horizontal bar chart.
If you look at the bar chart you will notice that the bars are not in order, this makes the bar chart less
aesthetic. To make a bar chart visually appealing, we must sort the bar chart either ascending or
descending, with a few exceptions like, when we are creating bar charts for visualizing temperature on
each day of a week, it is better to have the chart sorted based on the days and not sorted based on
values of temperature.
To sort our bar chart, hover your mouse just above the bars of the first “product sub-category”.
You will find an icon for sorting. Click on that icon to sort the bars.
Alternatively, you can click the icon in the tool bar to sort the data in descending order.
Now, look at your bars and try to figure out the number of products sold in each sub-category. Is it little
bit cumbersome to figure out the value for each product sub-category. We will try to get rid of this and
make our visualization more informative at first glance.
Also, the chart will look good, if we make the color of the chart vary according to the number of records.
Drag “Number of records” to “Color” under “Marks”. The color of the bars will change, with
most number of product sold being the darkest and least number of products sold being the
lightest in color. You can see a legend for the same in the right upper corner.
Click on the down arrow in the legend and select “Edit Colors”. Select “Red-Gold” from the drop
down and click Apply and OK.
Questions:
Step 2:
In this sheet we will try to visualize the “sales” data and the “profit” earned weekly.
Drag “Order Date” to the “Columns”. Right click on it and select “Week Number”.
Drag “Product Category” to “Rows”. Now drag “Sales” to “Rows”.
You will find that a time series has been plotted. Tableau decides on its own which graph to use for a
particular kind of data. We can override this by clicking on “Show Me” in the top-rightmost corner and
selecting our desired chart type. In the “Show Me” section, Tableau will show you all the charts that are
compatible with the data.
Click on “SUM(Profit)” in Marks and select the “Area” chart from drop down.
You will see the chart below for each category.
Now, inside the chart, right click on “Profit” under “Furniture” category and select “Dual Axis”.
Now you can see how the profit and sales are overlapped on each other giving us a view that tells both
week wise sales and profit for that week.
But there is still a problem. Look at the axes. The axis on the left is for “sales” and the axis on the right is
for “profit”. Both have different intervals which is making the visualization misleading.
Now, right click on the axis of “profit” and select “synchronize axis”. This will synchronize both axis and
give us the meaningful information.
Give your sheet a name “Weekly Sales and Profit”.
Step 3:
You will see four bubbles created on the sheet. The size of each bubble shows the number of
customers in that segment.
Step 4:
From the drop down select “Quick Table Calculation” -> “Percentage of Total”.
Add “Profit” under “Label” in Marks and follow the same steps for “SUM(Profit)”. You will
see the labels inside your char will get converted into percentage.
Give a name to your sheet “Region-wise Sales and Profit”.
Step 5:
Drag “Country” to the sheet. You will get the map of US.
Then drag “State” to the sheet. You will find all the states labelled by a dot on the map.
After this drag “profit” to “Color” and “Label” under Marks. You will see that all the states get
color coded based to the profit made by that state.
Now right click on “SUM(Profit)” under “Label” and select “Format…”
Click on the “Pane” panel and then down arrow in the “Font” textbox. Select Tableau Bold as the
font and make the font size 10.
Provide your solutions in a word document and your tableau file in twbx format.