When you connect to a new data source, Tableau assigns each field in the data source as dimension or measure in the Data pane, depending on the type of data the field contains. You use these fields to build views of your data.
Watch a Video: To see related concepts demonstrated in Tableau, watch Understanding Pill Types(Link opens in a new window), a 5-minute free training video. Use your tableau.com(Link opens in a new window) account to sign in.
About data field roles and types
Data fields are made from the columns in your data source. Each field is automatically assigned a data type (such as integer, string, date), and a role: Discrete Dimension or Continuous Measure (more common), or Continuous Dimension or Discrete Measure (less common).
Dimensions contain qualitative values (such as names, dates or geographical data). You can use dimensions to categorise, segment, and reveal the details in your data. Dimensions affect the level of detail in the view.
Measures contain numeric, quantitative values that you can measure. Measures can be aggregated. When you drag a measure into the view, Tableau applies an aggregation to that measure (by default).
Blue versus green fields
Tableau represents data differently in the view depending on whether the field is discrete (blue), or continuous (green). Continuous and discrete are mathematical terms. Continuous means "forming an unbroken whole, without interruption"; discrete means "individually separate and distinct".
Green measures and dimensions are continuous. Continuous field values are treated as an infinite range. Generally, continuous fields add axes to the view.
Blue measures and dimensions are discrete. Discrete values are treated as finite. Generally, discrete fields add headers to the view.
Possible combinations of fields in Tableau
This table shows examples of what the different fields look like in the view. People sometimes call these fields ‘pills’, but we refer to them as ‘fields’ in Tableau help documentation.
|Continuous Dimensions (dimensions with a data type of String or Boolean cannot be continuous)|
Note: With a cube (multidimensional) data source, the options for changing data roles are limited. (In Tableau Desktop, cubes are supported only on Windows.) You can change some measures from continuous to discrete, but in general, you cannot change data roles for fields in cube data sources. For related details, see Cube Data Sources.
A visual cue that helps you know when a field is a measure is that the field is aggregated with a function, which is indicated with an abbreviation for the aggregation in the field name, such as: . To learn more about aggregation, see List of Predefined Aggregations in Tableau and Aggregate Functions in Tableau.
But there are exceptions:
If the entire view is disaggregated, then by definition no field in the view is aggregated. For details, see How to Disaggregate Data.
If you are using a multidimensional data source, fields are aggregated in the data source and measures fields in the view do not show that aggregation.
Note: You can set the default aggregation and other properties and settings for fields. For details on the many ways you can customise the fields in the Data pane, see Organise and Customise Fields in the Data Pane, Edit Default Settings for Fields and Work with Data Fields in the Data Pane.
Examples of continuous and discrete fields used in a view
In the example on the left (below), because the Quantity field is set to Continuous, it creates a horizontal axis along the bottom of the view. The green background and the axis help you to see that it's a continuous field.
In the example on the right, the Quantity field has been set to Discrete. It creates horizontal headers instead of an axis. The blue background and the horizontal headers help you to see that it's discrete.
In both examples, the Sales field is set to Continuous. It creates a vertical axis because it continuous and it's been added to the Rows shelf. If it was on the Columns shelf, it would create a horizontal axis. The green background and aggregation function (in this case, SUM) help to indicate that it's a measure.
The absence of an aggregation function in the Quantity field name help to indicate that it's a dimension.
Dimension fields in the view
When you drag a discrete dimension field to Rows or Columns, Tableau creates column or row headers.
In many cases, fields from the Dimension area will initially be discrete when you add them to a view, with a blue background. Date dimensions and numeric dimensions can be discrete or continuous, and all measures can be discrete or continuous.
After you drag a dimension to Rows or Columns, you can change the field to a measure just by clicking the field and choosing Measure. Now the view will contain a continuous axis instead of column or row headers, and the field's background will become green:
Date dimensions can be discrete or continuous. Dimensions containing strings or Boolean values cannot be continuous.
Tableau does not aggregate dimensions. For a discussion of the different types of aggregation Tableau can perform, see List of Predefined Aggregations in Tableau.
In Tableau queries, dimensions in the view are expressed in SQL as ‘Group By’ clauses.
For details on converting fields between continuous and discrete, see Convert Fields between Discrete and Continuous.
How dimensions affect the level of detail in the view
The level of detail in a view refers to how granular the data is given the dimension and measure data in the view.
As you add dimensions to Rows or Columns, the number of marks in the view increases.
To understand why adding dimensions increases the number of marks in the view, do the following:
Drag Segment to Columns.
The status bar at the bottom of the Tableau window shows you that there are now three marks in the view:
Those marks just contain placeholder text,
Abc, because you are only building the view's structure at this point.
Drag Region to Columns.
Now there are 12 marks. Three values in Segment multiplied by four values in Region is 12.
Drag [Ship Date] to Rows.
The total is now 57 marks (three segments by four regions by five years is 60, but there are three combinations of the dimensions in the view for which there is no data in the data source).
We could continue adding dimensions to Rows and Columns and observe as the number of total marks continues to increase. Dragging a dimension to a location on the Marks card such as Colour or Size will also increase the number of marks, though it will not increase the number of headings in the view. The process of adding dimensions to the view to increase the number of marks is known as setting the level of detail.
Adding a dimension to any of the following locations in Tableau affects the level of detail:
The view now contains 57 separate instances of
Abc– the view is all structure and no content. Rectify this by dragging Sales to Text. The view can now be considered complete:
In some cases, adding a measure to the view can increase the number of marks in the view. For example, if you dropped Sales on Rows in the view above, the number of marks would be 57. But if you then also dropped Profit on Rows, the number of marks would increase to 114. But this is not the same as changing the view's level of detail.
The number of marks in the view is not guaranteed to correspond to the number you would get by multiplying the number of dimension values in each of the dimensions that make up the level of detail. There are multiple reasons why the number of marks could be lower. To increase the number of marks in this view from 57 to 60 in the view above, right-click (Control-click on a Mac) on one of the Date headers in the view and the date or bin headers and choose Show Missing Values. For more information about how to show missing values, see Show or Hide Missing Values or Empty Rows and Columns.
Measure fields in the view
When you drag a measure to the view, it is aggregated by default. The type of aggregation will vary depending on the type of view. You should always check the aggregation and change it if necessary. For details, see ‘Change the default aggregation’ in Edit Default Settings for Fields. For more details about aggregation, see Data Aggregation in Tableau.
When you drag a continuous field from the Data pane to Rows or Columns, Tableau creates a continuous axis for that field.
If you click the field and change it to Discrete, the values become column headers.
Tableau continues to aggregate values for the field, because even though the field is now discrete, it is still a measure, and Tableau aggregates measures by default.
In cases where Tableau has misclassified a field as a dimension or a measure, possibly because of the data type, you can convert it and change its role. If a measure contains numbers that don't need to be aggregated (such as a field that contains date values), you may want to convert it to be a dimension.
For related details, see Convert a Measure to a Dimension.
For details on converting fields between continuous and discrete, see Convert Fields between Discrete and Continuous.
How continuous and discrete fields change the view
Continuous and discrete are mathematical terms. Continuous means "forming an unbroken whole, without interruption"; discrete means "individually separate and distinct".
In Tableau, fields can be either continuous or discrete. When you drag a field from the Data pane to Columns or Rows, the values are continuous by default and Tableau creates an axis. When you drag a field from the Data pane to Columns or Rows, the values are discrete by default and Tableau creates column or row headers.
Continuous fields produce axes
If a field has values that are numbers that can be added, averaged or otherwise aggregated, it is added as a measure field in the Data pane when you first connect to a data source. Tableau is assuming that the values are continuous.
Tableau displays an axis when you drag a continuous field to Rows or Columns. An axis is a measuring line that shows values between a minimum and a maximum. Rulers and analogue thermometers are examples of physical objects that display axes.
Tableau must be able to show a range of actual and potential values, because in addition to the initial values in the data source, it is always possible that new values will emerge as you work with a continuous field in the view.
While there are value labels on a continuous axis (0, 0.5, ... 3.0 in the following image), actual marks don't have to align with these labels as they would with column headers. For example, in the following image, the blue bar actually extends to a value of 6.940 on the horizontal axis, not 7.0 exactly.
The number of potential values for continuous fields is impossible to anticipate. For example, if you have a field named Ratings and the initial values are 1, 3, 3.5, 3.6 and 4 – that's five distinct values. But if you drop Ratings on Rows, Tableau automatically aggregates that value as SUM (which you would then immediately change to AVG, because it's more logical to average grades than to add them), and that would then create a sixth value (3.02) that didn't exist until you added the field to the view. And if you then applied a filter that eliminated two of the initial values, the average would change as well, so that would be yet another value. And then if you changed the aggregation, ... You get the idea. The number of potential values is, if not infinite, then certainly immense.
The fact that a field contains numbers does not automatically indicate that those values are continuous. Postcodes are the classic example: though they are often composed entirely of numbers, they are actually string values which shouldn't be added or averaged. If Tableau assigns such a field as a measure to the Data pane, you should drag it to a dimensions area to change it to a dimension field.
Discrete fields create headers
If a field contains values that are names, dates or geographical locations – anything other than numbers – it is added as a dimension field in the Data pane when you first connect to a data source. Tableau treats the values as discrete.
Tableau creates headers when you drag a discrete field to Columns or Rows. The individual values for a discrete field become the row or column headings. Because these types of values are never aggregated, no new field values are created as you work with your view, so there is no need for an axis.
Discrete versus continuous fields on filters
When you drop a discrete dimension field on the Filters shelf, Tableau prompts you to choose which ‘members’ of the discrete field to include in the view.
When you drop a Date field on Filters, the result can be a discrete filter or a continuous filter. For more information, see Filter dates(Link opens in a new window).
When you drop a continuous measure on Filters, Tableau first prompts you to choose an aggregation for the filter, and then prompts you to specify how to filter the continuous range of values.
When you drop a continuous dimension on Filters (other than a Date), Tableau prompts you to specify how to filter the continuous range of values.
For more on filtering various types of fields, see Drag dimensions, measures and date fields to the Filters shelf(Link opens in a new window).
Discrete versus continuous fields on colour
When you drop a discrete field on Colour in the Marks card, Tableau displays a categorical palette and assigns a colour to each value of the field.
When you drop a continuous field on Colour, Tableau displays a quantitative legend with a continuous range of colours.
For more information about colour palettes, see Colour Palettes and Effects.