filmov
tv
How to create a 'Percent Of Total' calculated field without using table calculations in Tableau
![preview_player](https://i.ytimg.com/vi/LYjV2MOAJ2w/maxresdefault.jpg)
Показать описание
In this silent video, you'll learn how to create a view that shows the percent of total, without using table calculations. For example: when using table calculations in views that contain grand or subtotals, the grand/subtotals may show unexpected results with a table calculation in use.
- - - - - - - - - - - - - -
Step 1
1. Instead of table calculations, or using the TOTAL() function, use Level of Detail (LOD) expressions.
2. For example, using Superstore sample data, to show what percent of total each Segment is per Region:
Select Analysis and then Create Calculated Field. Name the calculation Percent of Total, enter the following calculation, and click OK:
{ FIXED [Segment], [Region] : SUM([Sales]) }/{ FIXED [Region] : SUM([Sales]) }
Step 2
1. Right-click Percent of Total in the Measures pane and select Default Properties ; Number Format... ; Percentage
2. Place Percent of Total on Columns.
3. Place Region on Rows.
4. Place Segment on Color.
5. Place Percent of Total on Label.
Related solutions:
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
Step 1
1. Instead of table calculations, or using the TOTAL() function, use Level of Detail (LOD) expressions.
2. For example, using Superstore sample data, to show what percent of total each Segment is per Region:
Select Analysis and then Create Calculated Field. Name the calculation Percent of Total, enter the following calculation, and click OK:
{ FIXED [Segment], [Region] : SUM([Sales]) }/{ FIXED [Region] : SUM([Sales]) }
Step 2
1. Right-click Percent of Total in the Measures pane and select Default Properties ; Number Format... ; Percentage
2. Place Percent of Total on Columns.
3. Place Region on Rows.
4. Place Segment on Color.
5. Place Percent of Total on Label.
Related solutions:
- - - - - - - - - - - - - -