You are on page 1of 7

Text Table

Text tables (also called cross-tabs or Pivot Tables) provide an easy way to display the numbers
associated with categorical data. In Tableau, you typically create a text table by placing a
dimension as the innermost field on both the Rows and the Columns shelf. Given this
description, a typical text table will use only dimensions for the rows and columns of a table. You
then complete the view by placing a field (usually a measure) on the Text shelf.
A text table uses the text mark type. Tableau can automatically select this mark type if the view is
constructed using only dimensions as shown below, and the Mark menu is set to Automatic.

Alternatively, you can manually select Text from the Mark menu for any data view. Refer to
Text Mark for information about this mark type.
The following examples show you how to use text tables to explore your data:
Text TableBasic
Text TableFilter and Color Encode
Duplicate as Crosstab

Text TableBasic

This view displays profit by product category, year, and region, in a text table.
You can create this view by following these steps.
1

Connect to the Sample - Superstore - English (Extract) data source.

Place the Order Date dimension on the Columns shelf.


The date is automatically aggregated by year, and column headers are created with labels
given by the dimension member names.

Place the Category dimension on the Rows shelf.


Row headers are created with labels given by the dimension member names.

Place the Sales dimension on the Text target on the Marks card.
The measure is automatically aggregated as a sum.

The resulting view is shown below.

Tableau automatically selects the mark type as text and the mark color as black. Each cell in the
table displays the sum of the sales for a particular year and category.
The data show, for example, that office machines had the highest sales in every year but one.
Suppose that instead of displaying the raw numbers, you want to display:

The percentage in each cell with respect to the entire table.

The grand totals for the rows and columns.

When your data are displayed in a text table, these things are easy to do.
1

To display percentages, select one of the percentage options on the Analysis


menu: Percentage of, and then, for our scenario, Table.

To display grand totals, from the Analysis menu choose Totals > Show Row Grand Totals
and then Totals > Show Row Grand Totals.

The resulting view is shown below.

Here's what this view shows:

Each data cell reflects the percentage of the entire table. For example, computer
peripherals in 2010 accounted for 1.04% of the total sales across all years and all
products.

The grand totals for rows are the bottom-most row in the table. Each cell reflects the
percent contribution for a given year. For example, 2010 contributed 20.19% of the total
sales across all years and all products.

The grand totals for columns are in the right-most column in the table. Each cell reflects
the percent contribution for a given product. For example, we can see that envelopes
accounted for 1.26% of the total sales across all years.

See Percentages for more information about displaying percentages. And see Grand Totals for
information on turning on and configuring grand totals.

Text TableFilter and Color Encode


This view is a text table that displays the profit as a function of product category, year, and
region. Additionally, the data are color encoded by product category and filtered to exclude
negative profits.
You can create the view with the following procedure.
1

Place the Order Date dimension on the Columns shelf.


The date is automatically aggregated by year, and headers are created with labels given
by the dimension member names.

Place the Product 2 - Sub-Category dimension on the Rows shelf.


Row headers are created with labels given by the dimension member names.

Place the Sales measure on the Text shelf.


The measure is automatically aggregated as a summation.

Place the Product 1 - Category dimension on the Color shelf.


Placing a dimension on the Color shelf separates the marks according to the members in
the dimension, and assigns a unique color to each member. The color legend displays
each member name and its associated color.

Filter by Profit.
Place the Profit measure on the Filters shelf and filter the data so that every row with
negative profits is excluded from the view.

The view is shown below.

The data show the sales for all products excluding rows with negative profits. Note that Rubber
Bands only had rows with positive profits in 2009, the other negative values are excluded from
the view.

Duplicate as Crosstab

The view shown below was generated as a crosstab from the bar chart example Bar ChartColorEncoded. Additionally, the rows and columns were swapped.
You can duplicate any view as a crosstab by selecting Worksheet > Duplicate as Crosstab. The
result will contain only dimensions in the Rows and Columns shelves. If measures are part of the

original view, the measure names will be displayed in the crosstab using the Measure Names
field. Views that are disaggregated cannot be duplicated as a crosstab.

Notice that the fields Measure Names and Measure Values appear on the Columns shelf and the
Text shelf, respectively. These fields were automatically included by Tableau so that the headers
and text values are included for the Profit and Sales measures.