Tableau Bump Chart compares one Dimension against another Dimension using one of the Measure value. Bump Charts will be very useful for exploring the changes in Rank over a time period or region etc.
In this article, we will show you, How to Create Tableau Bump Chart with an example. For this we are going to write the Custom SQL Query against the SQL Server Data Source so, Please visit Connecting Tableau to SQL Server article to understand the configurations. Custom SQL query we are going to use for this report is:
SELECT ProdSubCat.EnglishProductSubcategoryName, Tery.[SalesTerritoryCountry], Prod.EnglishProductName, Prod.Color, Fact.OrderQuantity, Fact.TotalProductCost, Fact.SalesAmount, Fact.TaxAmt, Fact.OrderDate FROM DimProductSubcategory AS ProdSubCat INNER JOIN DimProduct AS Prod ON ProdSubCat.ProductSubcategoryKey = Prod.ProductSubcategoryKey INNER JOIN FactInternetSales AS Fact ON Prod.ProductKey = Fact.ProductKey INNER JOIN [DimSalesTerritory] AS Tery ON Tery.[SalesTerritoryKey] = Fact.[SalesTerritoryKey]
Create a Tableau Bump Chart
Before we start creating Bump Chart, Let us create one calculated field to rank the Dimension members based on the Measure value. In order to do this, Please select the Create Calculated Field option from the Analysis Menu as shown below
Once you select the Create Calculated Field option, a new window will be opened to write the Custom Expression. For now, we are using the Build-in function called INDEX() and named it as Rank as shown below
Next, we converted the newly created calculated field to Discrete by right-clicking on the Rank filed and select the Convert to Discrete option
In order to create Bump Chart, Drag and Drop the Product Sub Category Name from Dimension Region to Columns Shelf and Sales Territory Country to Color Field present in Marks Shelf as shown below.
Next, Drag and Drop the newly created calculated field Rank from Measures region to Rows Shelf as shown below
From the above screenshot, you can observe that Rank field is ranking as first come first serve. It means, the First product is marked as Rank 1, second product as rank 2 and Last product is ranked as Rank 17. This is because By default, Rank filed is computing using the Table Across option but our intention is to Rank the Product Subcategory Name against Country Name using Sales Amount Measure
Before we start changing the calculated field, Let us change the Mark type from Automatic to Line Chart as shown below
Once you are done, the following screenshot will be appeared
In order to alter the table calculation of the Rank filed, Please click on the Rank filed on Column shelf and select the Edit Table Calculation.. option from the drop-down menu
Once you select the Edit Table Calculation.. option, a new window is opened. From the below screenshot you can observe that Rank filed is calculating the rank using Table (Across) option. That’s why, the First product is marked as Rank 1, second product as rank 2 so forth. In this example, Our intention is to Rank the filed by Sales Amount.
In order to achieve the same, Please select the Advanced option from the Compute Using the drop-down menu
Once you select the Advanced option, a new window is opened as shown below
Please transfer the Product Subcategory Name and Sales Territory Country fields from Partitioning to Addressing pane. Next, Change the Sort option from Automatic to Filed and select the filed name and aggregate field from the drop-down menus.
In this example, we want to rank the fields by Sales Amount so, we are selecting Sales Amount as Filed Name, Sum as Aggregated filed and Sort order as Descending as shown below
Click OK and change the Restarting Every option from None to Product Subcategory Name as shown below. It means, Table calculation (for Rank) will check for every new product and Rank them using its Sales Amount
Click OK to finish assigning the Table Calculation to our Bump Chart.
Let us see our final report preview
If you are not comfortable with the Rank field in separate Row, Please click on the Rank filed on Column shelf and unchecked the Show Header option from the drop-down menu as shown below
From the below screenshot, we successfully created tableau Bump Chart
Thank You for Visiting Our Blog