(low-tempo music)
- Hello, I am professor Rick Jerz,
and I welcome you to this session, titled Tableau Basics.
In this session, I plan to show you how to use
this powerful data-visualization product, Tableau,
to create some of the charts that we earlier learned
to produce using Microsoft Excel.
Learning a new software product can often be frustrating.
Make sure to relax,
and give yourself some time doing what I show you.
Also, it will be helpful to your learning
if after you complete this session, to wait a few days
and then return to the session and repeat it.
This process will reinforce your learning.
Okay, let's get started.
Our goals and objectives are as follows.
Using Tableau,
we want to create a pie chart for qualitative data,
create a frequency diagram for qualitative data,
create a histogram for quantitative data,
create a frequency polygon for quantitative data,
and create a combination chart for quantitative data.
Before doing what I'm going to show you in this session,
as a prerequisite, you should watch and do
Tableau's getting-started video.
The data that we will use for this session
is the same M&M data that we used earlier on in the course.
What I have done in the Excel file
that I have provided to you,
is to just move this data to cell A1,
just to clean it up a little bit.
Tableau does have the ability to clean up data,
but we haven't really explored how to do this yet.
I would encourage you to use your own M&M color data
as your qualitative data.
Let's see how close we can get to recreating this pie chart
I made with my M&M color data, using Excel,
but now we will use Tableau.
I have Tableau open,
and the first thing that I will do
is to connect to my Excel file.
I navigate to my downloads area,
and open the file, M&M data for Tableau.
To use the M&M color data,
I will drag this sheet into this work area.
And below, Tableau will show me the list of the colors
that I had in my bag of M&Ms.
Notice that I have just a list of the colors
with nothing being tallied in my original Excel file.
Before I do too much work in Tableau,
I'm going to make sure that I save this Tableau file,
and I will call it Tableau qualitative data.
Now it is easy for me to intermittently save this file
by just hitting control + s,
or command + s on the Mac.
Now, I pick go to worksheet, sheet one.
To create this pie chart,
I'm going to use Tableau's show-me wizard.
I left-click on colors,
then hold down my control key, or my command key on the Mac,
and click on number of records.
In the show-me panel, I see that a pie chart
is one of the possible choices right now,
so I do select it,
and immediately I have produced a pie chart.
I no longer need the show-me wizard, so I close it.
I want to see this pie chart in full view,
so I click on the standard drop-down menu
and pick entire view.
Tableau picks some default colors for each wedge,
but I want to make sure that these colors
match the colors of my M&Ms.
So I double click on this color blue,
and I make sure that the colors match their words.
I can add labels to the pie wedges
by dragging colors to label,
and I can add the count for each color
by dragging number of records also to label.
To change the numbers from values to percentages,
I drop down the text label SUM number,
and pick quick-table calculation, percent of total.
I also want to add a black border around all the wedges,
so I go to color, and I pick border black.
I double click on sheet one,
and change the name to pie chart.
Then, I double click on the title, pie chart,
and add, by Rick Jerz.
I center the title, and make it bold.
This pie chart looks pretty good, I think I'm done,
and I remember to save this chart.
Let's now turn our attention to making a frequency diagram.
Remember that my frequency diagram,
done in Excel, looks like this.
Can I duplicate this using Tableau?
Let's give it a try.
I will add a sheet and call this frequency chart.
I dragged colors to columns,
and number of records to rows.
Already, my frequency diagram is looking pretty good.
I will fit this to the entire view.
I want to color my bars to the colors of the M&Ms,
so I drag colors to color,
I double click the blue color just as I did before,
and I notice that Tableau
remembers all of the colors from my pie chart.
This is pretty nice.
I want to change the y-axis label
from number of records, to count.
So, I right click on this axis,
choose edit axis, and change the axis titles to count.
I can add the number of records to each bar
by dragging number of records to label.
I think I will add a black border to each of these bars
by going to color, border, and picking black.
And, the last thing that I will do
is improve the title of this chart,
I will add my name to it, and center this chart title.
Again, make sure to save this file.
We are done making two qualitative charts.
I will close this Tableau file,
and start a new file for our quantitative chart types.
Again, I begin this Tableau file
by connecting to my Excel file,
but in this case I will drag
the weight data into the work area.
Now, I'm ready to create my first sheet.
Let's see if we can create this histogram
that we created back in Microsoft Excel.
Remember that a histogram
is an appropriate kind of chart to make
when you have continuous data.
And in our case, we have continuous M&M weight data.
When we made this chart in Microsoft Excel,
we had to create bins,
and then count how many weights for each M&M
fell within a bin.
We tallied these up,
and then we were finally able to make this histogram.
Let's see how we can do this in Tableau.
Before I continue, I'm going to save this file
as Tableau quantitative data.
There might be a way to create this chart
by using Tableau's show-me wizard,
but I am going to try to create this
without using the wizard.
Just as in Excel, we had to create bins,
we kind of have to do the same thing in Tableau.
When I think about how we created
our color-frequency diagram,
colors were in the dimensions area of Tableau,
and we dragged colors over to columns,
and then the number of records to rows.
So I kinda want to be able to do the same thing
for continuous quantitative data,
so somehow I need to be able to create the bins.
Here's how.
Click the down arrow for the all weights
in the measures area, and select create bins.
I will name this field 'bins,'
and I will size the bins to be equal to 0.025.
This is what we used before in Microsoft Excel.
We see that bins is now in our dimensions area,
and I will drag this to columns,
and then drag number of records to the rows area,
and our histogram is taking shape,
except that we do have gaps between each bar,
and we want to be able to close these gaps.
We can do this by clicking on the down arrow to bins,
and changing this from discreet to continuous.
I can add a black border to each of the bars
my clicking on color order, black,
and I can add the number of records to each bar
by dragging number of records to label.
I will name this sheet 'M&M weights.'
And, once again,
I can change the title to M&M weights by Rick Jerz,
making this be bold and centered.
This looks pretty good.
We will say that our frequency diagram is complete.
Remember to save your work.
Now, let's create a frequency polygon.
I begin by duplicating our M&M weights sheets,
and I rename this to frequency polygon.
Making the frequency polygon becomes very simple.
I go to this marks area and, instead of using bars,
I choose line, and I am finished.
Once again, save your work.
The last chart that we want to produce
is this combination chart.
We need to be able to add a line to our frequency diagram.
I begin by duplicating our frequency diagram,
and I rename this sheet to combination chart.
I move number of records, again,
to the rows area.
This gives me two duplicated bar charts.
I will click on the second of these two in the marks area,
and change this from bar to line.
Then, I will click on the down arrow to this sum of numbers,
and add a quick table calculation, running total.
Then, I click on this sum of numbers in the rows,
and also pick running total.
This gives me a cumulative frequency line.
The key to combining these two charts
is to right click on the y-axis of this line chart,
and pick dual axis.
Wow, this is looking pretty good.
I double click on the right-side y-axis,
and change the name to cumulative count.
I'm going to change the color of this line to red,
and I think we are done with this combination chart.
Little by little, I think that I am getting
the hang of this Tableau application.
It does seem a lot more complex than Microsoft Excel,
but I can also start appreciating
some of the power that Tableau is providing to me.
I actually look forward to working a little bit more
with Tableau, but for now, we are done.
(low-tempo music)
Thanks for taking time to spend some moments with me.
I hope that you have enjoyed what I have shared with you.
If you ever have any questions, or need my help,
please let me know.
(low-tempo music)