Loading

Display Rank Based on Grand Total in Crosstab

發佈日期: Apr 29, 2025
描述

How to display Rank based on the Grand Total in a crosstab.

Cause

This feature is currently not built in Tableau Desktop.

The Rank calculation fields must be placed on the shelf as discrete. However, if the discrete fields are placed on the shelf, the Total cannot be displayed.
 
解決方案
Instead of using the total function, we will create a Calculated field that calculates the grand total.

User-added image

1. Connect to the Sample-Superstore datasource.
2. Drag Region to Columns and Sub-Category to Rows.
3. Drag Sales to Text on the Marks card.
4. Create a new calculated field as follows:
     Name : Grand Total
     Calculation : TOTAL(SUM([Sales]))
5. Right-click on Grand Total and select Convert to discrete.
6. Create a new calculated field as follows:
     Name : Rank
     Calculation : RANK([Grand Total])
7. Right-click on Rank and select Convert to discrete.
8. Drag Rank to the far-left position of Rows and Grand Total to the right-most position of Rows.
User-added image
9. Right-click on Rank on Rows and select Edit Table Calculation to set the following:
User-added image
 
知識文章編號

001496845

附件

Book1.twbx

1286 KB

 
正在載入
Salesforce Help | Article