How to add interactivity in a Scatter Plot visualization in Tableau – Skill Pill Video

Scatter Plot in Tableau - btProvider

For retail, consumer goods or eCommerce companies, data analytics is a vital element. Profit margins, sales margins depending on product categories, inventory situation or number of customers are some of the metrics that must be followed for an in-depth analysis of how the company works. Tableau Software is a complex data analysis and visualization tool that offers users unlimited possibilities for data exploration and understanding. One of the most popular types of graphics in Tableau is Scatter Plot. In today’s article we will discuss how to build a Scatter Plot chart and how to add custom sliders to provide interactivity to our analysis.

As we said, Tableau offers us countless possibilities to visualize our data. For consumer goods companies, data analysis on sales profitability plays an essential role in establishing future sales or marketing strategies. The Scatter Plot graph helps users to visualize and understand the distribution of measures in relation to others. But first, let’s see what this type of chart is and how it can be improved with more.

Custom Sliders for Scatter Plot

Scatter Plot is a chart that displays the correlations between two measures in a single visualization. Later, dimensions can be added for a better understanding of the data and for a complete visualization of them. The main role of this graph is to highlight the data outliers, along with the correlations between the analyzed measures. For example, the Scatter Plot chart helps us quickly identify which sales generated the highest or lowest profit.

Of course, Scatter Plot visualizations can be customized with other data analysis elements in Tableau, such as reference lines or trend lines to identify the information we are interested in more quickly. We can also add calculated fields or parameters to provide clarity in the data and to segment information relevant to us. In the visualization below we chose to use both calculated fields and parameters to identify profit and sales values in several situations: lower sales, but higher profit, higher sales, but lower profit, higher sales and higher profit, lower sales and lower profit.

Next, we will build a Scatter Plot chart and we will show you all the necessary steps you need to do in order to add custom sliders and more interactivity to your analysis.

Step 1: Connect to data

→ In Tableau Desktop, connect to Superstore sample data provided by  Tableau.

Step 2: Create the visualization

→ Create a calculated field named Profit per Order with the formula:
{ FIXED [Order ID] : SUM([Profit]) }

→ Create a calculated field named Sales per Order with the formula:
{ FIXED [Order ID] : SUM([Sales]) }

→ Right click on the Profit per Order calculated field and select Create -> Bins. Select the Size of bins to be 1.

→ Right click on the Sales per Order calculated field and select Create -> Bins. Select the Size of bins to be 1.

→ Create a parameter named Profit Parameter. From the Data type select Integer and for the Current Value type in a value, for example -2471.

→ Create a parameter named Sales Parameter. From the Data type select Integer and for the Current Value type in a value, for example 8539.

→ Create a new Sheet named Profit Slider. Drag the Profit per Order (bin) and Profit Parameter on Rows. Right click on Profit per Order (bin) and select Continuous.

→ Change the visualization type for Profit per Order (bin) to line and for the Profit Parameter to Circle.

→ Create a new Sheet named Sales Slider. Drag the Sales per Order (bin) and Sales Parameter on Columns. Right click on Sales per Order (bin) and select Continuous.

→ Change the visualization type for Sales per Order (bin) to line and for the Sales Parameter to Circle.

→ Create a new Sheet named Sales vs Profit. Drag the Sales on Columns and Profit on Rows. From the Marks Area change the visualization type to Circle.

→ Create a calculated field named Quadrant with the formula:
IF SUM([Sales])>[Sales Parameter] and SUM([Profit])>[Profit Parameter] THEN ‘High Sales/High Profit’
ELSEIF SUM([Sales])>[Sales Parameter] and SUM([Profit])<=[Profit Parameter] THEN ‘High Sales/Low Profit’
ELSEIF SUM([Sales])<=[Sales Parameter] and SUM([Profit])>[Profit Parameter] THEN ‘Low Sales/High Profit’
ELSE ‘Low Sales/Low Profit’
END

→ Drag the calculated field Quadrant on Colour and Order ID on Detail.

→ Create a Dashboard with the Profit Slider, Sales Slider and Sales vs Profit Sheets.

→ Go to Dashboard -> Actions -> Add Action -> Change Parameter. Name this action Update Profit parameter. From the Source sheets select Profit Slider, from the Run Action -> Select, from the Target Parameter select Profit Parameter and from the field select Profit per Order (bin) and for Aggregation select None.

→ Create another Parameter Action, named Update Sales Parameter. From the Source Sheets select Sales Slider, from the Run Action on -> Select, from the Target Parameter select Sales parameter and from the field select Sales per Order (bin) and for Aggregation select None.

By Adelina Popescu

Download Tableau Software