# Creating Hierarchies

Hierarchies allow you to structure your data in a multi-level format, enabling you to drill down into details in a step-by-step manner. For example, a hierarchy such as *`Country → State → City`* provides an intuitive way to analyze data across geographical levels. By using hierarchies, you can:

* Quickly navigate from summary-level data to granular details.
* Organize dimensions in logical sequences for better insights.
* Explore summary-level metrics (e.g., total sales by country) and drill down into details (e.g., sales by city).

### **How to create hierarchies**

1. Under **Data → Prepare → Data,** select the required dataset and click on **Edit.**
2. Above **Data Pipeline**, click on the **Hierarchies** option.

<figure><img src="https://content.gitbook.com/content/s16h5onryWtbaHwBa10b/blobs/HPHIZintEW6pr6nIWsLU/image.png" alt="" width="563"><figcaption><p><strong>Data → Prepare → Edit</strong></p></figcaption></figure>

2. The following window will be displayed if there are no exisiting hierarchies.

<figure><img src="https://content.gitbook.com/content/s16h5onryWtbaHwBa10b/blobs/Uk0kHg9XAhboaXh9CFTi/image.png" alt="" width="563"><figcaption><p>When no hierarchies are present</p></figcaption></figure>

2. Click on the **Plus (+)** icon. This action initializes a blank hierarchy structure with no predefined fields.

<figure><img src="https://content.gitbook.com/content/s16h5onryWtbaHwBa10b/blobs/ZO2g0wYhuvjpsOmZ3CzK/image.png" alt="" width="563"><figcaption><p>Creating a new hierarchy</p></figcaption></figure>

3. Click on the **“Add New Dimension Field”** button. This opens a dropdown where you can select the field to include in your hierarchy. Example: Start with *"Country"* as your first dimension.
4. Repeat the process to add more fields. Each field added to the hierarchy represents a level in the drill-down structure. For example, add "*State"* as the second level, followed by *"City"* as the third.
5. To create additional hierarchies, click on the **+ Add** button.
6. Click on the **Hierarchy 1** field at the top to rename the hierarchy.
7. After completing the setup, click **Save** or click on **Cancel** to dismiss. The hierarchy is now embedded in your data pipeline.
