Working with bins
1. Working with bins
Let’s move on to the last demo screencast of this chapter. We're going to start by enhancing the histogram from before by adding in some labels. To do this you’ll need to click on Label in the Marks card and then check on this box to show the labels. We also want to make the font size a little smaller because the bars are very narrow. While we’re here, we are also going to change the alignment and make it vertical so it fits the bars better. That way we can see more values portrayed. Tableau has some internal rules about not showing things that are visually crowded. Looks better right? Next, we are going to learn how to adjust the bin size of the histogram. This is a part of the certification exam so pay attention if you’re interested in taking that. Bins are basically the bars in the histogram. As you can see, at the moment every bar is related to one age. We can group multiple ages together and put them into buckets, or bins. Let’s create a bin of three years here. You can do this directly from the Age field. Right-click, navigate to Create, and then select bins. In the dialog box that pops up I get the chance to say how many years I want to add to each bin, 3 in this case. And I’m going to call this new field Age (3 year bin). Click okay on that. Now I'm going to replace the Age field up here with that value and let the histogram be presented this way instead. Let's also exclude the null values. So this gives us a different perspective compared to before. As you can see, each bar now represents an age range of 3 years. If you look at the tallest bar, you can see the total number of trips taken by users that are 27, 28 or 29 years old. Changing the bin width will allow you to reveal different insights. Bins that are too wide can hide important details about distribution while bins that are too narrow can cause a lot of noise and hide important information about the distribution as well. So it’s worth exploring what works best for your data. All right, that's it. Time for you to start changing bin widths!2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.