Last Modified Date: 03 Jan 2019
Environment
Tableau DesktopAnswer
This example uses the Superstore sample data set.Step 1: Create the basic view
- Place SUM(Sales) on Columns.
- Place Product Name on Rows.
- Place Region on Color.
Step 2: Create Calculated Fields
- Select Analysis > Create Calculated Field.
- Name the field. In this example, the field is named Total Sales Per Item.
- Type the following into the Formula field, then click OK:
WINDOW_SUM(SUM([Sales]))
. - Select Analysis > Create Calculated Field.
- Name the field. In this example, the field is named Rank.
- Type the following into the Formula field, then click OK:
RANK_DENSE([Total Sales Per Item])
.
Step 3: Configure Calculated Fields
- Drag Rank to Filters.
- Click OK.
- Right-click Rank in the Filters shelf.
- Select Edit Table Calculation.
- Configure Rank as follows:
- Select Specific Dimension
- Move Region above Product Name and check both boxes.
- At the level: Product Name.
- Select Nested Calculations > Total Sales Per Item.
- Configure Total Sales Per Item as follows:
- Compute using: Region.
- Click OK.
Step 4: Complete the view
- Ctrl+Click and drag Rank from Filters to Rows.
- Right-click Rank in the Rows shelf.
- Select Discrete.
- Right-click Product Name in the Rows shelf.
- Select Sort and configure as follows, then click OK:
- Sort order: Descending
- Sort by:
- Field: Sales
- Aggregation: Sum
- Right-click Rank on the Filters shelf and select Show Filter.
- Filter view as desired.
Additional Information
Note: If multiple dimensions are used on Rows, WINDOW_SUM may not produce the desired result. In this case, use the TOTAL() function instead.Discuss this article... Feedback Forum
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