Table
A table visual displays dataset data in a tabular format, making it easy to view, compare, and analyze individual records and values. You can sort the data by any displayed measure or dimension by clicking a column header. Each click cycles through ascending, descending, and unsorted order. Table cells can also be formatted using format strings.
The following example demonstrates how to create a new tabular visual representation on the World Life Expectancy dataset. For information about the shelves available for this visual type, see Shelves for tables.
-
Create a new visual based on the
World Life Expectancydataset.For instructions, see Creating a visual. By default, the table shows all fields in the dataset. If your starting point is another visual type, select Table in the VISUALS menu.
By default, the table visual displays all available dataset fields.
-
Review the available shelves.
- Dimensions
- Measures
- Tooltips
- Filters
- Limit
None of these shelves are required. If you do not add fields to any shelf, all available columns are displayed.
-
To show only specific items, populate the shelves from the fields available in the
DATA menu.
- Under Dimensions, select 'country' and drag it to the Dimensions shelf.
- Under Measures, select 'life_expectancy' and drag it to the Measures shelf.
-
Change the aggregation from
'life_expectancy' field from 'sum(life_expectancy)'to'avg(life_expectancy)'.- On the Measures shelf of
the visual, click the caret-right icon to the right of the
'sum(life_expectancy)'field. - In the FIELD PROPERTIES menu, click the caret-right icon next to Aggregates to open a drop-down menu.
- From the list of aggregate functions, select Average.
- Click the x icon at the top of the FIELD PROPERTIES menu to close it.
The shelf now contains the modified field with the
avg()aggregation function.Alternatively, you can change the aggregation at the level of the dataset, as described in Changing field aggregation.
- On the Measures shelf of
the visual, click the caret-right icon to the right of the
-
Click REFRESH VISUAL.
The updated table visual appears. It displays the average life expectancy by country.
- Optional:
To improve the appearance of the visual, alias the 'country' field as 'Country' and the
'life_expectancy' field as 'Life Expectancy'.
- On the shelf of the visual, click the caret-right icon to the right of the field.
- In the FIELD PROPERTIES menu, click the caret-right icon next to Alias.
- In the text box below Alias, enter the alias name of the column, as it should appear in the visual.
- Click the x icon at the top of the FIELD PROPERTIES menu to close it.
The shelves now show the columns with their alias names.
- Optional:
On the Filters shelf, you can add several
Dimensions and Measures from the
DATA menu.
This enables you to dynamically control the data input and discover the data at a more granular level.
For example, from Dimensions, drag the 'un_region' and 'year' fields to the Filters shelf.
In this example, 'un_region' is set to 'Americas'. It should appear as un_region in ('Americas') on the Filters shelf. 'year' is set to '2001 through 2010'. It should appear as year in (2001,2002,…,2010) on the Filters shelf.
- Optional:
Change the value on the Limit shelf to another number.
In this example, the new value is '12'.
-
Click REFRESH VISUAL.
The updated table visual appears.
-
Click the pencil/edit icon next to the title of the
visualization to enter a name for the visual.
You can also add a brief description of the visual as a subtitle below the title of the visualization.
- At the top left corner of the Visual Builder, click SAVE.
