Sign in or start a free trial to avail of this feature.
6. Using the Analytics Tab in Your Visualizations
The analytics tab enables you to add reference lines and bands to your charts. In this lesson, we will learn to insert both constant and computed lines into a bar chart.
To explore more Kubicle data literacy subjects, please refer to our full library.
- Enables you to add lines and bands to your visualizations
- Lines can be manually entered (e.g. reference lines) or calculated (e.g. average)
- Similarly, bands can be manually entered or calculated (e.g inter-quartile range)
- The most commonly-used analytics options are included under the Summarize menu
- To create your own calculated lines and bands, use the Custom menu
Table, pane and cell
- To apply a line to the full view, select Table
- To apply to a pane (e.g. Q1) within the view, select Pane
- To apply each individual data point, select cell - mostly used for box-plots
In our visualizations, we often want to include additional features such as average lines or distribution bands. In this lesson I'm going to show you how to add these features to visualizations in tableau for this lesson I have moved to a new dataset that shows software sales by company over a 12 month period.
And so for each entry, I have payment days, revenue, number of users and company name. What I want to do in my visualization is to chart revenue by month and add a line for average revenue to my visualization. Let's grab revenue and place it in rows. And I'll take payment date and place this in columns.
I'll open this out for quarters and for months. Now, I'd like to add a revenue line to this chart and to do so, we go to analytics in the top left-hand corner and this opens a couple of different options labeled under summarize model and custom. In this particular lesson we'll cover, summarize and custom. I'm going to look at model in a later course, let's start by taking the constant line and dragging onto the view. When I do this it creates a constant line across all of our bars. And this enables us to include a line of any value that we want. So for example, if we had a target for the year of 1.5 million in revenue per month I can add in a line of 1.5 million.
I know this is included on my chart. Constant lines can sometimes be a value particularly when you want to include a budgetary or target measure, but average is much more useful.
So to remove the constant line I simply click and drag off the view.
Let's now try average line. So I'll drag onto the view and this gives me three options, table which will calculate the average for all months pane which will calculate the average for each quarter and cell which will calculate the average for each month.
Let's start by looking at table.
So in this example I get the average value across all 12 months. Well, this is useful. I think I'd prefer it to have the average line for each quarter. So again, that's drag off the view and instead put an average line that splits by pane and this gives us four different averages corresponding to the four different quarters. Oftentimes when you add an average line to a chart you'll need to format this value, particularly on the hover which in this case shows a lot of decimal places. So to do so, right click on the line and go to format and then format we can switch the numbers to custom and under no decimal places.
When I go back to my chart, this is now fixed. Let's now take a look at some of the other options in the analytic structure.
Low average line we have median with quartiles. Let's see how this looks. So I'll drag average of the view and add median with quartiles.
And again, I'll go with the table option to begin with, and this shows me the median or middle value for the 12 data points. And it shows me the inter quartile range. So 25% of the points are below this value and 25% of the points are above the upper quartile value . This particular feature tends to work well when we have a lot of data points, particularly on an X-Y scatter plot. I'll remove with Control Z. Now let's add totals, which looks like an interesting option. Again, total this gives me two options subtotals and row grant totals. So when I add totals this creates a new bar under each quarter and it also adds one bar at the very end for total revenue.
This doesn't really help my visualization because it makes each monthly revenue bar look too small. So again, I'll remove with Control Z.
Now let's take a look at some of the custom options starting with reference lines. And this scenario I'll go with pane and reference line starts by default with average but this option allows you to customize the line to your needs. For example, we could include the maximum, minimum, median have a constant or total.
In this example, I think I'll go with median.
We can also change the value. If we have new parameters in here the label is under computation. So if median is computed, median will be the label. We can also create custom if we wish. And lastly, we have formatting I want to change the color of the line. I simply use the structure and I can also fill above and fill below and see what this looks like select a color and press okay.
And now I have the area of the chart underneath the median.
Next up is a reference band and the reference band is very similar to the reference line. The only difference being, that we put in at least two values instead of a single value.
The default value for reference band is the minimum and the maximum values which I'm now showing for the different quarters.
Again, this can be for the entire table instead of each individual quarter.
The same options that appeared for the reference line also appear for the reference band such as fill, line color and the different computation options.
The final feature that we're going to cover in this lesson is the distribution band. But first I'll remove the reference band from the chart and I'll simply hit remove to do so. When I add the distribution band again I'm given the table of pane and Cell option.
This timeout select table, and with the reference band we're automatically given a computation of between 60 and 80 percent of the average.
Let's make this a little easier to read by changing the color.
And now we can see which values fall within this band, namely, November and December when sales tend to be lower to change the values in this band, we can simply hit the dropdown and change the number, let's say 120 and then I press tab and you can see the reference band changing accordingly. Instead of percentages, I can include percentiles, quantiles and I can even include a standard deviation.
When building your own charts, I'd recommend testing out a number of these distributions bands and lines to see which work well for your visualization. If you typically have budgets I like to use reference lines or bands for this figure. Outside of that, I tend to use averages quite a lot which tend to add quite a bit of insight to a chart.