Business intelligence is all about people. We need to help people understand data as quickly as possible so that they make strategic decisions more quickly.
Unfortunately, decision makers can end up being distracted by a need to mash data together in Excel. Worse, they may even expend time in trying to understand the data in the first place, rather than using the time to analyze the data to make an informed decision. This has a pernicious impact on the organization since decision makers are diverted from their role and contribution to the organization.
One proposal is to take a step back and re-evaluate the business questions and how they are answered. Due to the requirement that the data is correct and current, users could be provisioned with data that is insulated from the operational systems and merged together. This could help to answer the business need for a decision to be made using the data on the dashboard.
In this recipe, we will load the fact table called FactInternetSales
first, and then we will load the dimension tables. We will look at joining tables together and putting the tables into Tableau's memory. When we do this, we relieve some of the pressure that is produced when we create an unnecessary proliferation of snapshots of data. In turn, data silos need to be mashed up by business users in order to get the information they need. We will join tables together so that the business users can get results more quickly using Tableau, rather than trying to merge lots of smaller spreadsheets together.
For the exercises in this chapter, open a new Tableau workbook and name it Chapter Four
.
FactInternetSales
file and select it.DimDate
, to the canvas on the right-hand side.DimDate.csv
, select Date Key. Your join should look like this:Spanish Day Name of Week
French Day Name of Week
Spanish Month Name
French Month Name
DimProduct.csv
to the white canvas. Tableau will do the join for you. It will join the ProductKey
column in the DimProduct
file to the ProductKey
column in the FactInternetSales
table.DimProductSubCategory
file from the Files section on the left-hand side to the canvas. Again, Tableau will do the join for you. The join will use the ProductSubCategoryKey
column in the DimProductSubCategory
table to join with the ProductSubCategoryKey
column in the DimProduct
table.DimProductCategory
table to the canvas. As mentioned earlier, Tableau will do the join for you. Tableau will use the DimProductSubCategory
key in the table to match with ProductCategoryKey
in the DimProductSubCategory
table.DimSalesTerritory
file from the Files section, and drag it to the canvas area. Tableau will take the SalesTerritoryKey
column in the DimSalesTerritory
table, and use it to join with the SalesTerritoryKey
column in the FactInternetSales
table.To assist you further, here is a table that shows the table name and its key:
Table name |
Key |
---|---|
|
|
|
|
|
|
|
|
Your canvas should now appear as follows:
FactInternetSales
table, which does not have a value in the DimDate
table, then it will not be returned, and vice versa.As you can see, the tables are located in the Data pane on the left-hand side.
To summarize, in this section, we have shown different ways of joining tables in order to alleviate a situation where people are copying and pasting data all over the place. By unifying all the data that the users need into one distinct place, it will save them time and energy that they could use to make better decisions.
Tableau has its own data engine, which is an analytics database. It uses compression, which means that it can store a lot of data. It also involves techniques to make data retrieval very fast. It is a flexible data model, and you can work on the data very quickly in the same way as it is represented on the disk.
We saved the data extract, which is a separate file from the Tableau workbook. It has the file extension .tde
, which stands for Tableau Data Extract. This extract file can be reused directly without having the source connection details. This is extremely useful for portability. You can also use it as a way to prototype the dashboard. Further, you can anonymize a dataset and load it into an extract file. Then, you can ask the developer to work from the anonymized extract file. Once the development is complete, you could change the source connection so that Tableau connects to real-world data.
Here is a trick—if you want to verify the number of rows loaded into Tableau's data engine, then take the Number of Records metric and put it into the Marks shelf. This will give you a quick check to see if the number of rows loaded matches what you expect. If the number is much lower or higher, then one of your joins may be wrong. It's best to do this before you start or you will have to redo the work!
What happens if you have made a mistake and want to delete worksheets? You can delete worksheets by right-clicking on the worksheet tab, and selecting Delete Sheet.
When you attempt to delete a worksheet, you will notice that there is no option to delete the sheet. You can see an illustration of this feature in the following screenshot:
If the worksheet is used in a dashboard, Tableau will not allow you to delete a worksheet if it is reused elsewhere. In order to get around this feature, you need to delete the dashboard first, and then you'd need to delete the original worksheet. Tableau doesn't let you delete all the worksheets; however, it needs a worksheet in order to show data!