Tableau basics
Importing
Joining data
More with calculations and filters
Finding the story – more with chart types
Deliverables
Using the lobbying data from the previous assignment, we will combine/join it with population data in order to make more sense of what is going on. Answer the following questions in separate Worksheets in Tableau. Use different charts to explain your answers (not just bar chart).
Which city has the highest spending per person (per-capita) on lobbyists? What are the top 3 counties with the highest spending per-capita?
How many counties with more than 10,000 are there, and how many cities with more than 10,000 are there (2010 population)?
Compare the highest spending county and city with 2010 population and 2000 population. Any difference?
What is your new conclusions based on the data? Has your story changed compared to last week’s exercise?
The power of joins
The best investigators know how to make connections between seemingly disparate things. An early example of using computers to make connections involved a list of felons and a list of school bus drivers. The journalist – Elliot Jaspin – used a computer to join the two databases and found felons who were not supposed to be near children driving the buses!!
But first, he needed to learn about joins J
Open a new workbook and connect to lobbyingdata.xlsx
Next, we add our censuswa.xlsx file. Do that by clicking Add in the connections area of your screen.
Note: In this case, we want an extract of the data-sets, not just to make a live connection
The power of joins Tableau automatically previews the first data set you selected – LOBBYINGDATA1.
But how do we bring in the second data set? Just drag it into the area next to sheet1 from the lobbying data.
When you do a join, Tableau will open a dialogue box for you to select how to join this data. There are several options. And these hold true for any software you may use to join data.
Inner Join. When you use an inner join to combine tables, the result is a table that contains values that have matches in both tables.
Left Join. When you use a left join to combine tables, the result is a table that contains all values from the left table and corresponding matches from the right table. When a value in the left table doesn't have a corresponding match in the right table, you see a null value in the data grid.
Right Join. When you use a right join to combine tables, the result is a table that contains all values from the right table and corresponding matches from the left table. When a value in the right table doesn't have a corresponding match in the left table, you see a null value in the data grid..
Outer Join. You add all the records from each data set together, even when there is no join. (used rarely)
Tableau does a great job of explaining joins in a visual way. Let’s take a look:
Now, that you have two different data sets, you will see both of them represented on the left hand side under Tables and Measures.
How can you take advantage of the Census data we now have attached to our lobbying information?
Let’s create some calculated fields:
We will re-create that calculated field for total. See if you can remember how.
Now, let’s create a per capita – a rate – so we can tell how much was spent on lobbying per person in the cities and counties.
So, do we think we know what the story might be? Try per_capita and compare with total compensation.
Let’s add in population to the tool tip so we can take a closer look. This is easy to do.
Drag Pop2010 onto the tooltip icon on the marks shelf.
That field will show up below the icons with the visual cue to the left that it’s associated with the tooltip. Now, when you hover over the bar chart, you can get a sense of the population of the community as well as the rate
We used filters a little bit in an earlier module, but now we’re going to do even more with filters to get a little more familiar with how to make use of them. As we just discussed, let’s try filtering out those communities with smaller populations.
Drag Pop2010 onto the filters shelf.
When you do, a dialogue box will open. We want to set the minimum population at 9999. That way, we will filter out any towns and counties with populations under 10,000 where the rate would be skewed because the population is so small.
Finding the story: How else could we look at these data to find possible stories? Play around with other data to try and understand what is going on.
In the next lab, we’ll begin to pull all of our work together into one Tableau Dashboard. For now, let’s save our work
Select File/Save As
Then name your workbook with your lastname_lobbying
We will also save this workbook as a packaged workbook. Tableau makes sure you have all the data you need packaged up within the workbook itself. We will use the saved workbook for the Assignment next week
We have a team of tableau expert and professionals, at here you can get all tableau related data analysis project help with an affordable price.
Send your requirement details at :
realcode4you@gmail.com and get instant help
Comments