Tableau Tricks – Using Shapes and Bar Charts to get Instant Insights

.

 

Introduction

As Business Intelligence professionals, developing visually-intuitive dashboards for optimal data insights is one of our daily task. This is the first blog article of a series of articles where we will share useful tricks for developing key analytics tools with Tableau in order answer your questions or test your hypothesis.

In this blog article, we will explain how to combine shapes and bar charts to compare KPI performances over two periods of time. The main benefit of this approach is that the analysis is highly intuitive, so we get the data insights straight away.

 

Use Case

Imagine that you are the Head of Sales for the Mediterranean territory of a manufacturing company and you would like to know the difference between 2017 sales and 2016 sales by country (by percentage). As you can see, with this approach you can visually compare the sales by year for each country in a clear and easy way.

Below are all the steps that we need to follow in order to generate this analysis:

1 First, we need to create three calculated fields: “Sales 2017”, “Sales 2016” and “Sales Diff %”

Figure 1: Formula to calculate sales in 2016

Figure 2: Formula to calculate sales in 2017

Figure 3: Formula to calculate % difference between sales in 2017 and 2016. We multiply it by 100 because afterwards this value will be converted to string

 

2 Secondly, we have to create the bar chart, moving the “Country” dimension to Columns and the  “Sales 2016” and “Sales 2017” measures to Rows.

Figure 4: Tableau bar chart with separate measures

 

3 Then, you have to apply some steps to change the look and feel of the bar chart. Here, we moved “Measure Names” to the Color tile, applied “Dual Axis” to one of the bar charts and resized the size of the bars from the Size tiles.

Figure 5: Tableau bar chart with “Dual Axis” applied, and with the bar size narrower for “Sales 2017” measure

 

4 After customizing the look and feel, we need to create two new calculated fields, “Icon UP” and “Icon Down”. These fields will indicate if the sales in 2017 are increasing (Icon UP) or decreasing in relation with 2016.

Figure 6: Formula with the text when de “Sales Diff %” is positive

 

Figure 7: Formula with the text when de “Sales Diff %” is negative

 

5 Finally, we have to move these two calculated fields into the Label tiles to display the yearly sales variation. Note that you will also need to change the Color label to make this analysis more intuitive.

 

In the “Sales 2016” mark,  we put “Icon Down” into Label tile.

Figure 8: In the “Sales 2016” mark, we put “Icon Down” field into Label tile

 

In “Sales 2017” mark,  we put “Icon Up” into Label tile.

Figure 9: In the “Sales 2017” mark, we put “Icon Up” field into Label tile

And this is the final result:

Figure 9

Figure 10: Bar chart to compare sales between 2017 and 2016 with text that shows the % difference

 

 

Conclusions

We can use some icons as text instead of using shapes, so that we take advantage of embedment into Labels or Tooltips.

These kind of analysis are very engaging when we perform data analysis or when we are currently in the data discovery processes because they allow us to get insights in a very quick and visual way.

As a Tableau partner, we are certified with the last Tableau Certifications, so do not hesitate to contact us if you have any data challenge in mind.

 

Cross-Database Join functionality with Tableau 10

.

Cross-Database Join, one of the most anticipated features in Tableau 10

Tableau 10 comes with a great new feature called Cross-Database Join, which allows us to cross data between different sources easily and intuitively.

In previous Tableau versions, you needed the Data-Blending solution to join data from different databases. This feature works well enough in one-to-one relationships, but unwanted asterisks pop up when we want to perform a join in one-to-many relationships. JOIN Data from Different Sources is one of the most voted for ideas in the Tableau community for avoiding this scenario and at last we got this great feature in August with Tableau 10.

In this article we are going to reproduce these painful asterisks by applying Data-Blending and then explain how to use Cross-Database Join functionality to escape such limitations.

 

1. Data-Blending

Imagine that we want to analyse sales by employee and region and that the data comes from different sources:

➜ Oracle table: contains region details

➜ Excel file: contains region details and sales by employee

Notice that in the second data source, there are multiple employees by region, so in order to cross data between both data sources we use the Region Name field whose relationship is one-to-many.

 

Figure 1: Primary Data source

Figure 1: Primary Data source

Figure 2: Secondary Data source

Figure 2: Secondary Data source

As we mentioned before, when we apply Data-Blending in one-to-many relationships we get asterisks in those cases where a specific region contains more than one employee.

Figure 3: Data-Blending

Figure 3: Data-Blending

Until now, there was no quick way to avoid these asterisks, and technical IT knowledge was needed to apply database federation between connections.

 

2. Cross-Database Join

Cross-Database Join is the new feature that Tableau 10 provides to cross data between different sources much faster and without any additional technical knowledge. Let’s explain how to perform a Cross-Database Join, step by step, using the same example and data sources as before.

First, we need to include the Oracle DB table as a primary source and the Excel file as a secondary source. Once both data sources are available, we need to carry out the following steps to apply Cross-Database Join:

1. Place on localhost connection (HR Oracle Schema data source).

2. In table area, double click on REGIONS to use this entity.

3. Perform the same steps to include Employee Sales entity from Employee connection (Excel file). Now you can see that Tableau tries to join both entities automatically.

4. Click on the circles icon; a Join set-up window will appear.

5. Select which kind of join you want to perform.

6. Select the specific fields of each entity that you are going to use to apply the join. In our example, they are “Region Name” field for REGIONS entity and “region Name1” field for Employees Sales.

7. After following the above steps, just click on “Update Now” to display the join results.

Figure 4: Cross-Database Join, step by step with Tableau 10

Figure 4: Cross-Database Join, step by step with Tableau 10

If we reproduce the same analysis as before (sales by employee and by region), Tableau 10 aggregates fields from the second data sources without any issues and asterisks do not appear in the analysis.

Figure 5: Data-Blending Tableau 9.3

Figure 5: Data-Blending Tableau 9.3

Figure 6: Cross-Database Join Tableau 10

Figure 6: Cross-Database Join Tableau 10

It’s easy to see the benefits of this new feature. Cross-Database Join functionality will allow us to cross data between different data sources and types in an easier and more intuitive way (avoiding those painful asterisks when using Data-Blending). It is a very interesting improvement that many Tableau users will welcome to create their daily scorecards.

If you want to know the latest news about Tableau 10 check our previous post and keep updated!

Click here if you would like to receive more information about the topic!

privacy policy - Copyright © 2000-2010 ClearPeaks

topnav