May 27, 2019
#MakeoverMonday: What has happened since people started paying attention to climate change?
What works well?
- Using a line chart over time helps show the trends
- Including a slider filter for the user to zoom in on a specific period
- Using dotted lines indicates there are breaks in the timeline, but there aren't. Therefore, a solid line should be used.
- The labels on the ends of the lines hide the data.
- It could use an impactful title and subtitle. Though I suppose this is just a report, not analysis.
I created a map to ensure that the country names were correct. When I did this, I then saw that there were lots of aggregations of countries. For some reason, the income level categories captured my attention so I filtered down to just those items.
The years 2015-2018 were include and didn't have any values. I filtered those out. There were years when no data was captured for some countries. I filtered those out.
I plotted the data as a line chart and created a calculation to show the change vs. the first year for each country. I noticed that there was a spike in CO₂ per capita in 1973 for high income countries. This reminded me of the oil crisis of 1973, but that wouldn't have anything to do with carbon emissions I wouldn't think.
That got me thinking about climate change in general. I entered "when did people start paying attention to climate change" into Google and the first search result was an article from National Geographic titled "Climate Change First Became News 30 Years Ago. Why Haven’t We Fixed It?"
This particular line was what I was looking for: "The Intergovernmental Panel on Climate Change was established in late 1988..."
So, back to the data I went and I filtered the data to 1988-2014 and compared every subsequent year to 1988 in order to see how much things have changed since climate change started garnering some attention. I expected high income countries to have ever increasing CO₂ per capita. I was wrong.
It turns out that the middle income countries have had the largest change in CO₂ per capita. So that became the focus of this analysis.
March 20, 2019
#MakeoverMonday Data Studio Edition: Reykjavik Index for Leadership in G7 Countries
DATA PREP REQUIRED
- Add values for the remainder (100 - index)
- Add a sort column
- Pivot the data so that the index and the remainder were in the same column
WHAT WORKED WELL
- To create the stacked bar chart, all you need to do is select the chart type and drop the fields on the appropriate shelves.
- Customizing the split of the colors for the index and the remainder was easy.
- I was able to customize the size of the viz.
- You can choose any font that Google supports!!
- The tooltips are super responsive.
- Everything looks very crisp.
- Hiding the gridlines leaves a nice thin black line on the y-axis without me needing to fiddle around with a few different settings.
- The overall UX is quite intuitive. I see they have a data explorer now too.
WHAT I COULDN'T OVERCOME
- I couldn't find a way to show only the mark labels for the purple bars.
- I couldn't add a reference line for the G7 average so I had to leave it in the view.
- I couldn't hide the x-axis only. When you do, the y-axis gets hidden as well.
July 31, 2012
Tableau Tip: Dynamic axis selections with parameters in less than five minutes
Here’s the situation: You have multiple measures that you want to view across time, but you don’t want to see all of the measures at the same time. Instead you want the user to be able to pick the measure to view.
Parameters to the rescue!
Andy Cotgreave blogged about user built views in his Data Studio days. In this blog post I will provide the step-by-step directions. The charts types you can create with the technique are seemingly endless, but I’ll go through a simple scenario.
Step 1 – Right-click anywhere in the Measures or Dimensions windows and choose Create Parameter. Create a parameter named “Choose a measure” with the settings below. Note that I am giving this a name that will instruction the user as to what to do.
Step 2 – Find the parameter you just created in the Parameters window. Right-click on it and choose “Create Calculated Field”.
Step 3 – Use a CASE statement to build the calculated field. This field is telling Tableau what measure to use based on the value chosen in the “Choose a measure” parameter.
Step 4 – Add Order Date to the column shelf and your new “Measure chosen” measure to the row shelf. For this example, I’ve expanded the Order Date field to Quarter.
Notice how the y-axis is labeled “Measure chosen”. We’ll clean that up in a bit.
Step 5 – Right-click on your “Choose a measure” parameter in the Parameter window and choose “Show Parameter Control”. It should appear on the upper-right of the window.
Make different selections in the parameter control and notice how the y-axis and the chart change dynamically.
Step 6 – Drag the “Choose a measure” parameter to the row shelf. Again, make different selections in the parameter control and watch the label change.
We’re almost done. Just a bit of formatting remains.
Step 7 – Clean up the chart.
- Right-click on the field that shows the “Choose a measure” value and select “Rotate Label”
- Right-click on the row label and choose “Hide Labels for Rows”.
- Double-click on the “Measure Chosen” axis to bring up the Edit Axis window. Delete the title.
That’s it. You’re final viz should look like this:
If you’re like me, once you saw this technique, you began thinking of all of the possible uses. Play around with lots of different use cases. Try scatter plots, dual-axis charts, bubble charts, etc. You can control ANY of the shelves using parameters. Imagine the guided analysis you can provide your users and the exploration they’ll be able to do on their own. It’s almost like creating a pivot table for them.
If you want a slightly more complex version, I created a scatterplot of NBA franchise values that allows you pick the x-axis, y-axis and size, all with parameters.
Parameters are quite powerful. Leverage them!
Download the sample workbook here.