top of page

Advanced Tableau Visualisation part-2


3. Dendrogram

4. Radial Barchart

5. Sunburst chart


Data: For all 3 visualizations we have used a Sample superstore data set which is a fictional Data set commonly used for practice purposes: Sample Superstore Dataset - Gigasheet


Dendrogram

Dendrogram Charts and Tableau

While Tableau doesn't natively support dendrograms, you can create a workaround chart to visualize hierarchical clustering data.

Dendrogram in a Nutshell:

A dendrogram is a tree-like chart that depicts relationships between observations or groups in a dataset.  Branches that join lower down the chart indicate a stronger relationship between those groups. Each branch length reflects the distance or dissimilarity between the merged groups. This helps researchers understand how data points can be naturally grouped into clusters based on shared characteristics.

Implementation in Tableau:

Here's a simplified approach to create a dendrogram-like chart using the Sample Superstore data and focusing on total sales vs. segment contribution:

  1. Calculated Fields:

  • Create a Path field (integer) with a fixed increment (e.g., 1) to establish the hierarchy.  This path will serve as a reference point to position elements within the chart based on their hierarchical level.

  • Create a Rank table calculation (integer) that assigns a unique rank to each subcategory within its category. This rank will determine the order of subcategories within each branch of the chart.

  1. Marks and Shelves:

  • Set the Mark Type to Line.

  • Drag "Sub-Category" onto Color. This will assign a distinct color to each subcategory, helping to differentiate them visually.

  • Drag "Path" onto Columns (Right-click and choose "Show Missing Values"). Drag again to Detail.  Adding Path to Columns and Detail shelves will leverage it to determine the position of the lines on the X-axis.

  • Drag "X" (measure, likely Sales) onto Columns. Right-click and choose "Compute Using" > "Path". This ensures the X-axis values are calculated based on the path level, effectively creating a stepped line for each subcategory.

  • Drag "Y" (likely Segment) onto Rows. Right-click and choose "Compute Using" > "Path". Like the X-axis, this step ensures that the path determines the Y-axis positions, showcasing the hierarchical relationship between subcategories within their segments.

  1. Fine-tuning:

  • Right-click on the "Y" pill and choose "Edit Table Calculation."

  • Set "Nested Calculation" to "Y."

  • Set "Compute Using" to "Specific Dimensions" and select only "Sub-Category." This table calculation ensures the Y-axis positions are ranked based on the subcategories within each segment.

  • Do the same for the "Rank" calculation, setting "Nested Calculation" to "TC_Rank" and "Compute Using" to "Specific Dimensions" with only "Sub-Category" selected.  This refines the ranking order of subcategories within the chart.

This creates a chart with lines representing subcategories, positioned and colored based on their category and rank. It mimics the branching structure of a dendrogram to some extent, providing a visual representation of the hierarchical relationships between subcategories within segments.







Radial Barchart

A Radial Bar Chart utilizes a circular layout to represent comparisons between categories. Bars extend outward from the center, with their length representing the value for each category. This chart is useful for visualizing how parts contribute to a whole.

Radial Bar Chart with Functions in Tableau (Sample Superstore)

This approach utilizes calculated fields to create a radial bar chart showcasing total sales per region in the Sample Superstore dataset.

1. Calculated Fields:

  • Create a calculated field named Angle using the RADIANS function: RADIANS(SUM([Number of Records])) This calculates the angle for each region based on the total number of records (or any field representing data point count). Each region gets assigned a proportional angle on the radial axis.

  • Create a calculated field named Bar Size using the WINDOW_SUM function: WINDOW_SUM(SUM([Sales]), 0, SUM([Number of Records])) This calculates the total sales for each region but takes into account the total number of records in the view. This ensures bars are sized proportionally based on total sales relative to the overall dataset size.

2. Marks and Shelves:

  • Set the Mark Type to Bar.

  • Drag "Region" onto Color to differentiate regions visually.

  • Drag Bar Size onto Size to control the bar length based on the calculated total sales for each region.

  • Drag Angle onto Angles to position each bar along the circle based on the calculated angle, creating the radial layout.

3. Formatting :

  • You can remove unnecessary chart elements like grids, axes, or headers to focus on the radial bars themselves.

  • Consider adjusting the size of the chart and bars for better readability.

Benefits of using Functions:

  • The RADIANS function ensures a proportional radial layout based on data point count.

  • The WINDOW_SUM function considers the overall dataset size for bar sizing, providing a more accurate comparison.






Sunburst chart

Sunburst charts, also known as radial tree maps, are visualizations ideal for displaying hierarchical data using concentric circles. Each circle represents a level in the hierarchy, with the innermost circle depicting the highest level and subsequent circles representing subcategories. The size of each slice within a circle corresponds to a value associated with that specific category or subcategory.

Data Preparation:

  • Ensure your data includes at least two dimensions defining the hierarchy. In this case, we'll use "Year" (higher level) and "Sub-Category" (lower level).

Building the Sunburst Chart:

Marks and Shelves:

  • Change the Mark Type to Pie.

  • Drag the higher-level dimension (Year in our case) onto the Detail shelf. This creates the base layer of the circles.

  • Drag the lower-level dimension (Sub-Category) onto the Color shelf. This assigns a color to each subcategory slice within the year circles.

Formatting:

  • Sorting:  You can sort the subcategories within each year by dragging "SUM(Sales)" (or another measure representing sales) to the Color shelf before "Sub-Category." This will order the subcategories by sales within each year, with the largest slices appearing outermost.

  • Calculated Fields: Create calculated fields to customize the


  • size or color representation based on specific data manipulations.

Limitations:

  • Tableau doesn't inherently support drilling down within a Sunburst chart to explore lower levels of the hierarchy.





Comments


bottom of page