7. Creating X-Y Scatter Plots for Two Measures


X-Y scatter plots are fantastic visualizations when plotting large datasets and clustering. They can also interact really well with text tables, as we will see in this lesson.

To explore more Kubicle data literacy subjects, please refer to our full library.


Scatter plots

- Accept two measures and plot these in a very easy-to-read visualization
- Can also be color-coded with dimensions and adjusted for size
- Excellent at identifying outliers and clusters of data points
- Can also work with reference lines and bands

Interacting with text tables

- Scatter plot selections can interact with text tables by applying Use as filter functionality
- Simply place the text tables adjacent to your scatter plot and they will update automatically
- Try including a total sum and a list of each selected point in your adjacent text tables


XY scatter plots have similar advantages to box plots, which we explored in an earlier lesson. Specifically, they show you the distribution of each data point, rather than an aggregate calculation such as average, median, or some that you would normally see in a bar chart. As a consequence, they are especially good at spotting outliers, or individual clusters of data points that may be of interest.

In this lesson, we're going to return to our accountancy firm data set to create the following XY scatter that compares the value of each client to the accountancy firm, with the debtor days for each client. Debtor days is an accounting metric used to see how quickly a client pays back the firm. Debtor days is incredibly important for professional services firms from a cash flow perspective.

In our final chart, we will combine the XY scatter with two text tables that interact with the scatter. So for example, if I wanted to isolate my largest customers to see how much value they provide, I simply select these top six, and I immediately get their names, the fees generated by these clients as a total sum and individually.

So how do we create this chart? Well, let's start with the XY scatter.

All XY scatter plots require two measures one for the x axis and one for the y axis.

I'm going to put value on the x axis. So I'll simply drag into the rows shelf.

And on the x axis, I'm going to put debtor days, which can be found in a new data set that I've added off camera to the tableau workbook. First, I'll make sure the data sets are linked on the client column and add debtor days to columns.

I don't want the sum of debtor days.

What I actually want is the single value associated with each client. And so I'll change SUM to MAX.

Now I need to add client to the detail. It's important that I add client from the primary data source, which is the transaction data.

Otherwise, my filters may not work when I add my sheets to the dashboard.

I can also add my quartiles from the analytics tab. And here I'll select max debtor days.

And this shows me how many clients are in each quarter of debtor days. From the data, I can see that certain clients have zero debtor days, which means they pay immediately, and other clients have debtor days all the way up to around 255.

And these clients simply are not paying their invoices anywhere close to being on time.

You can also use average lines or reference lines in the analytics tab on an XY scatter. But be sure not to include too many lines so that the chart doesn't get cluttered and becomes harder to interpret.

What would be great, however, is if we could select a group of customers in our XY scatter, for example, the bottom right hand corner, and their names and certain values related to those customers appear dynamically on the right hand side.

To do this, I'm going to create a dashboard off camera and add this sheet to the dashboard.

Next, I'm going to create two sheets, the first of which will simply show the sum of revenue. So going back into my transaction data set, I'll simply calculate the sum of value.

And I'll show this as a text table.

I'll create another sheet that will do the same.

Although this time, it'll show client on each row, and then value.

I'll sort these by size and turn into a text table.

Now I'll go back to my dashboard and off camera, I'll add these two sheets to my dashboard with a bit of formatting to add some nice headings.

I now have all the data that I need on my dashboard. All, that's left for me to do is to make my chat interactive. So I'll select it and click on the filter icon on the top right hand corner, which says use as filter.

Now when I select a couple of customers that are of interest, for example, low value customers that don't pay me very quickly, all the data on the right hand side updates. So this cohort of customers gives me over $160,000 in fees, and I can see them ranked by revenue on the right hand side.

This gives the managing partner a great overview of his customer quality. And he can perform very quick analysis on an interactive chart like this. For example, he might want to see his exposure to his top six clients. Let's select the top six clients.

And we can see that they give just under $500,000 in fees, which is around 30% of the total. He may want to diversify his customer base over time, and rerun this chart in a couple of months.

While XY scatter plots are very useful, they become much more beneficial when combined with interactive text tables, as I've shown you in this lesson.

Tableau Essentials
Creating Visualizations in Tableau


My Notes

You can take notes as you view lessons.

Sign in or start a free trial to avail of this feature.

Free Trial

Download our training resources while you learn.

Sign in or start a free trial to avail of this feature.

Free Trial