1. More data management
Alright, in this screencast we are going to take a look at some non-standardly labeled location information and give them the appropriate geo role. After that we’ll add them to a hierarchy so that a drill down or drill up can be accomplished. We’ll also see how to change the default aggregation method.
If you look at the Data pane over here, you’ll see that there is a field named ST. On the Data Source page we can see that this field holds the state information. Let’s rename the field to State first to make sure end users can easily interpret visualizations using state information. I’m also going to assign a geographic role to it by right-clicking and under geographic role, selecting State/Province. Note that had the field been named in a standard format, for example state, as it arrived in Tableau, the software most certainly would have picked it up.
Now, there are several ways to create a hierarchy. You can right-click on the field and select Create Hierarchy here. You could also take one of the other fields that will go into the hierarchy, for example Country and drag it on top of State. I’ll name the hierarchy Location. Let’s arrange the fields from big to small. So Country first, State next, and I’ll add City last. As you can see all fields are recognized as geographic values, which means Tableau can easily create maps with the data. I’ll double-click on State to add it to the sheet. As you can see Tableau automatically generated the longitude and latitude information and added it to the Columns and Rows shelves, as well as Country and State over here. I’ll do the same for Sales to make the circle sizes variable. So you can quickly add things to this visualization with zero effort. And then to drill down, we can use the hierarchy over here by clicking the plus and minus signs to add more or less detail. An important thing to note here, is that this is all powered by us having correct designations of data types and geographic roles for these fields.
Next, we are going to look at a different type of default property, the default aggregation. Let’s take a look at Discount. As it stands, Discount, and any numeric value in the Measure section of the Data pane is going to be brought into a visualization as a sum. Let me show you. I’ll add Segment to Rows and Discount to Columns. As you can see, the aggregation used is sum. This isn’t the most appropriate aggregation. Since Discount is a decimal, or percentage, it wouldn’t make sense to sum these values. Of course, we always have the option to go in here and change it to average. However, wouldn’t it be great if Discount would always be averaged? This is a place where we can turn to default properties. We’re going to tell Tableau that we always want to bring Discount in as an average. I’ll do that by right-clicking on Discount, navigating to Default Properties, and under Aggregation I’ll choose Average. If I now remove Discount from the visualization and bring it back in, you’ll see that average is used instead of sum. So once again, we’ve seen that default properties are a great way to refine and characterize your data so that it’s consistently presented every time.
That's it. Over to you!
2. Let's practice!