Last Modified Date: 30 Nov 2023
Environment
Tableau DesktopAnswer
Option 1: Use a custom background image
See Use Background Images in Your Views for directions. Please note, this option is not dynamic, meaning if the parameter values change, the background will have to be manually adjusted.
Option 2: create a dual axis chart, where one axis is polygon marks to fill the quadrants
- Join the attached "quadrant scaffolding.xlsx" to the existing data source with a FULL OUTER join. For the linking field, create a join calculation in both the left with the value 1, and use "Dummy Linking Field" from the right table.
- Create a calculated field with a name like "x values" with a calculation similar to the following:
MIN(
IF [Quadrant] = "data"
THEN { FIXED [Customer Name] : SUM([Profit]) }
ELSEIF [Quadrant] = "lower left"
OR [Quadrant] = "upper left"
THEN
IF [Corner] = 1
OR [Corner] = 2
THEN { FIXED : MIN( { FIXED [Customer Name]: SUM([Profit])})}
ELSE [x-axis parameter]
END
ELSE
IF [Corner] = 1
OR [Corner] = 2
THEN { FIXED : MAX( { FIXED [Customer Name]: SUM([Profit])})}
ELSE [x-axis parameter]
END
END
) - Create a calculated field with a name like "y values" with a calculation similar to the following:
MIN(
IF [Quadrant] = "data"
THEN { FIXED [Customer Name] : SUM([Sales]) }
ELSEIF [Quadrant] = "lower left"
OR [Quadrant] = "lower right"
THEN
IF [Corner] = 1
OR [Corner] = 4
THEN { FIXED : MIN( { FIXED [Customer Name]: SUM([Sales])})}
ELSE [y-axis parameter]
END
ELSE
IF [Corner] = 1
OR [Corner] = 4
THEN { FIXED : MAX( { FIXED [Customer Name]: SUM([Sales])})}
ELSE [y-axis parameter]
END END ) - Create a calculated field with a name like "Data Points" with a calculation similar to the following:
IF [Quadrant] = "data"
THEN [Customer Name]
END - Drag [x values] to the Columns shelf
- Drag two copies of [y values] to the Rows shelf. This should create two scatter plots, each with a single point, one on top of the other. There will now be three Marks cards: All, AGG(y values), and AGG(y value).
- Click on the first copy of AGG(y values) on the Rows shelf to open its corresponding Marks card.
- In the dropdown, change the mark type from Automatic to Polygon.
- Drag [Quadrant] to Color on the Marks card.
- Drag [Corner] to Path on the Marks card.
- Click Color and click the Edit Color… button to change the colors as desired.
- Click on the second copy of AGG(y values) on the Rows shelf to open its corresponding Marks card
- Drag [Data Points] onto Detail.
- Right-click the second copy of AGG(y values) on the Rows shelf and check Dual Axis.
- Right-click either y-axis in the view and check Synchronize Axis.
- Right-click the second copy of AGG(y values) on the Rows shelf and uncheck Show Header.
Additional Information
Notes on Option 2- Joining the quadrant scaffolding creates duplicate data, but this duplication is necessary in order to compute dynamic coordinate values for the corners of the quadrants
- This example starts with a scatter plot created by [Profit] on the x-axis, [Sales] on the y-axis, and [Customer Name] on Detail to create each point. Replace [Profit], [Sales], and [Customer Name] with the corresponding fields.
- The way that [x values] and [y values] are written assumes that the lower left corner of each quadrant is corner 1, with the numbering continuing counter clockwise. See diagram below.
- The left most x coordinates (corners 1 and 2 for the upper left and lower left quadrant) should be the smallest value of profit per customer in the entire data set, which is the expression { FIXED : MIN( { FIXED [Customer Name]: SUM([Profit])})}.
- The inner FIXED statement returns SUM([Profit]) for every unique value of [Customer Name]
- The outer FIXED statement returns the smallest value of the inner FIXED expression over the entire data set
- To add buffer to the quadrants, subtract the desired value from the minimum profit per customer in [X values], and add the desired value to the maximum profit per customer
To voice your support for the inclusion of this feature request in a future product release, add your vote to the following Community Idea: Reference Line Quadrant Shading
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials