In Business Intelligence, dates are an essential part of analysis, and they are an important part of Business Intelligence projects. Data warehouses, for example, have a Date dimension as a way of helping business users to describe their data by date. People's business questions often include a when element. Additionally, dashboards will often reference dates.
Comparison is fundamental to analysis. Time is a fundamental part of comparison. Dashboards will often display comparisons between periods of time, so time is an essential part of the dashboard display. It is easy to envisage the following business questions that involve time:
This recipe explains how to use dates in order to analyze your data using the Dates functionality in Tableau. In the last recipe, we imported the FactInternetSales
table. Once the FactInternetSales
data has been imported, we will also do the same for the DimDate
table. To analyze our data, we will perform the following actions:
We will continue to use the same Tableau workbook we set up in the first recipe. It was called Chapter 2
.
DimDate.xls
and import it into Tableau's internal data store mechanism. To do this, navigate to Data | Connect to Data.DimDate.xls
file and select it.Connection_DimDate
.DateKey
and OrderDateKey
columns together for the DimDate
and FactInternetSales
tables respectively. Make sure that the DateKey
and OrderDateKey
columns are both dimensions, not measures. So, ensure that both fields are contained in the Dimensions field; if not, drag them from the Measures pane to the Dimensions pane. If they are measures, then we cannot join them.Connection_DimDate
data source in the Data pane in the sidebar.DimDate
columns and the other for the FactInternetSales
columns. Each column represents a table, and the items in the list are source fields.FactInternetSales
table, drag the SalesAmount column from the Measures pane to the Canvas shelf. You can see this in the following screenshot:OrderDateKey
column and select Count Distinct for the SalesAmount figure, Tableau turns the SalesAmount pill to red and grays out the whole screen. You can see an example of this in the following screenshot:Tableau allows business users to enrich their data through the addition of calculations that get stored as part of the workbook. This is useful for data analysis, since we can look and see how simple steps can quickly affect the data.
Why is this the case? Tableau issues separate queries to each data source and joins the two data sources together. Then, it conducts the aggregation on the joined data sources at the lowest level of detail in the view of the data from the Tableau interface.
Unfortunately, if the level of detail in the underlying query is different from the level of detail in the view, then the calculation will not be correct.
The moral of the story is to keep the relevant dimensions in the Tableau view, that is, put their features in the Columns and Rows shelves or in the Marks shelf. By putting more elements in the view, these shelves will move the query towards serving up data that can be used for matching the data sources. Then, the user can try to incorporate the query by including as many dimensions as possible, which in turn will produce as much detail in the query as possible in order to facilitate matching between the tables.
Dashboards use a lot of calculations to summarize data. Research by specialists such as Ben Shneiderman shows that people tend to want to see the summary first, followed by zooming and filtering the data, and then finally see the details on demand. This is a very natural way of engaging with data. Shneiderman calls this the "Visual Information Seeking Mantra".
If you are interested in the psychology of how individuals interact with data, then Ben Shneiderman's paper The Eyes Have It (1996), which you can find at http://dl.acm.org/citation.cfm?id=834354, will be of help.