top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

How To Create a Dendrogram Chart In Tableau






Introduction:


A dendrogram chart is a tree-like diagram used to illustrate hierarchical relationships between data points. It is commonly used in hierarchical clustering, phylogenetics, and data analysis to show how elements are grouped based on similarity or distance. The branches of the dendrogram represent clusters, with the height of each branch indicating the level of similarity between connected elements


This blog analyzes a dataset focusing on ABG (Arterial Blood Gas) results in patients. The ABG values—pH, PaCO2, and HCO3—are used to categorize conditions into Respiratory Acidosis, Respiratory Alkalosis, Metabolic Acidosis, and Metabolic Alkalosis.


First, connect the dataset into the data source. Then, create an Excel sheet named "Sheet1" with two values, ensuring the column name is set as "Path." as mentioned in the below picture 1.1.


Picture 1.1: Creating an Excel File for Integration
Picture 1.1: Creating an Excel File for Integration

Open the dataset, then drag sheet1.csv into the workspace. When prompted to join both datasets, create a join column and enter 1 as the join key for both files as shown below picture 1.2.


Picture 1.2:Joining Excel File with Dataset for Integration
Picture 1.2:Joining Excel File with Dataset for Integration

After joining the dataset with the CSV file, both datasets will be visible. Next, create calculated fields in the sheet: Sigmoid as 1/(1+EXP(-[X])), and Rank using RANK_UNIQUE([Patient count], 'desc'). Define the X-axis as (INDEX()-1) 0.12 - 6 and the Y-axis as [Sigmoid] ([Rank] - (WINDOW_MAX([Rank]) + 1) / 2) / 100. Define Total Patient as WINDOW_COUNT(COUNTD([Patient ID]))/2 and Patient count as WINDOW_SUM(COUNTD([Patient ID]))/2 Finally, set Path as a bin for further analysis.


Create calculated fields for percentage as [Patient count]/[Total Patients] & percentage Adj as [percentage]/WINDOW_MAX([percentage])


Create a calculated field for ABG Analysis to classify results into four categories: Respiratory Acidosis, Respiratory Alkalosis, Metabolic Acidosis, and Metabolic Alkalosis based on pH, PaCO2, and HCO3 levels.


Drag the X-axis into Columns and the Y-axis into Rows. Right-click on the X-axis and Y-axis, then set their computation as Path (bin).


Next, edit the table calculation for the Y-axis, setting the X-axis as a specific dimension using Path (bin). Then, specify the Y-axis as Path (bin) & ABG Analysis, the Rank as ABG Analysis, and the Patient Count as Path (bin) for accurate visualization.


Set Marks to Line, then drag Path (bin) onto Lines and ABG Analysis onto Colors for visualization as shown below picture 1.3.


Picture 1.3:Adjusting X-axis and Y-axis with Table Calculations
Picture 1.3:Adjusting X-axis and Y-axis with Table Calculations

Drag the Size field into Size, then modify and edit the table calculation. Set the X-axis as a specific dimension using Path (bin). Next, define Percentage Adj with Path (bin) & ABG Analysis, Patient Count using Path (bin), and Total Patients with Path (bin) & ABG Analysis to ensure accurate visualization., for accurate visualization.


  • Drag Patient Count and ABG Analysis into the Label field to display them on the visualization as below picture 1.4.


Picture 1.4:Modifying Size Calculated Field with Table Calculations
Picture 1.4:Modifying Size Calculated Field with Table Calculations

Adjust the formatting by increasing the size, making the heading bold, and enlarging the font. Also, set the count to display as whole numbers, and remove headers and grid lines by using format. With these final touches, the dendrogram chart is complete as shown below picture 1.5!



Picture 1.5: Dendrogram Chart with Formatting Enhancements


A dendrogram chart is a powerful tool for visualizing hierarchical relationships in data, making it invaluable for clustering analysis and classification. By structuring data into branches based on similarity, it provides clear insights into patterns and groupings. Whether used in biological research, customer segmentation, or decision-making processes, dendrograms enhance data interpretation and facilitate informed conclusions. Implementing them in Tableau allows for dynamic and interactive exploration, helping users uncover meaningful connections within their datasets.

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page