# Hierarchy structure

The visual supports two kinds of hierarchical structures:

### **1.      Id and Parent Id columns**

The hierarchy can be established by having the parent-child relationships defined for every row of data. For example: An organization data, a row of data can correspond to an employee in the company.

We need two columns to establish the parent-child relationships:

1\.      Each of these rows must have a unique identifier column, like the Employee Id.

2\.      Another column must contain the parent row’s identifier column, like the Manager Id.

The ‘Hierarchy Field’ data field must be populated with the Id column, while the ‘Parent field’ must be populated with the Parent Id column.

<figure><img src="/files/M7hxJFb2B5S5aeoB3E2r" alt=""><figcaption></figcaption></figure>

The visual now has the hierarchy structure displayed on the canvas:

<figure><img src="/files/YbrjBiQaxzfntyyTxvfG" alt=""><figcaption></figcaption></figure>

*Note: The Id and PId columns can also be name columns (like Employee Name and Manager Name respectively). Since Name uniqueness cannot be guaranteed, we recommend using unique Id columns like Index columns.*

### **2. Multiple Category Columns**

Provide multiple Category Columns in the ‘Hierarchy Field’ to set the hierarchy for the visual, as shown below:

<figure><img src="/files/LISJ1ASLfTxuYzoybJoX" alt=""><figcaption></figcaption></figure>

The values in the leaf level will be picked from the data model. Aggregations for the higher levels will be done within the visual.

Aggregation options are available as follows:

<figure><img src="/files/GPdZdCJR0SK0wC0Yb560" alt=""><figcaption></figcaption></figure>

Enable ‘Total’ node as the root node for a grand total.

The hierarchy will be plotted as shown below:

<figure><img src="/files/4fyrPNQAaGbaybYfx0kX" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xviz.com/performance-management/configuring-the-chart-structure/hierarchy-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
