# Hierarchy Layout

When you are working with multilevel data, you can structure them using the hierarchy layout. PowerTable supports hierarchical layouts for viewing your data in addition to the `Table` layout.

This feature is helpful for use cases where data can be neatly organized into hierarchical structures, such as employee databases, categorical datasets, customer orders, and so on. You can configure a hierarchy layout for table data and then switch between them as needed.

Let's take an example of the employee database in the default table view:

![](/files/b93490412fbcbb8700901515b4ec8260ab5d727e)

Employee database

The table consists of a list of 100,000 employees. Let us organize them in a hierarchical structure for easier navigation and a clear representation of who reports to whom.

{% stepper %}
{% step %}

### Click on **Layout > Hierarchy**

Click on **Layout > Hierarchy** to set up the Hierarchy layout.

![](/files/69c3704b5283525d7f1878ed343eaf9a08e8ce3d)

Select hierarchy layout

The layout configuration box opens, as below:

![](/files/5f402b69d18ff0cc8a3e6eacc453457df91780f5)

Hierarchy Layout Configuration

Alternatively, you can configure a hierarchy layout first by clicking on **Layout > Manage Layout.**
{% endstep %}

{% step %}

### Choose the **Primary Key Column**

Choose the **Primary Key Column.** The *EmployeeID* column here serves as the primary key for the employee table.

![](/files/920bd840929fda126f9efce24b6bb08906f0c6e8)

Primary Key Column
{% endstep %}

{% step %}

### Choose the **Hierarchy Column**

Choose the **Hierarchy Column.** The hierarchy column is the one containing the data that you want to use to group your records. This column represents the parent level for all records in the table.

We have chosen *ManagerID* as the hierarchy column because it not only uniquely identifies all managerial employees, but it also acts as a link between all employees and their managers.

![](/files/2784ce393acb6eddf1a6967f29511a3639a84d29)

Hierarchy column
{% endstep %}

{% step %}

### Select the **Display Column**

Select the column to be displayed in the hierarchy mode as the **Display Column.** This column should be different from the Hierarchy Column.

We have chosen the *FullName* column so that the full names of the managerial employees appear at the parent levels in the hierarchy mode. Click **Save.**

![](/files/28f3ef71d69c243092d73f5ae47ea71f0e9ed60c)

Display name for hierarchy levels
{% endstep %}
{% endstepper %}

The hierarchy mode gets displayed, as below:

![](/files/cf616295baafb4190eeb19209650a6f65d3f8475)

Hierarchy mode

* The display column is pinned, allowing you to scroll past other fields.
* All employees are neatly organized under their managers, allowing for easier navigation and understanding.
* The number of child rows under each parent is displayed alongside it.

#### Options available at the parent-level rows

![](/files/48f2a6915e3cb7f126bbccc9cf19399841cb2303)

**Expand and Collapse Levels**

You can use the arrows to expand or collapse the parent level. Alternatively, you can select the options —Expand and **Collapse**, respectively. Select **Collapse All** to collapse all parent levels in the table.

**Move To**

Select this option to move a specific record to another parent. Click this option, then choose from the list of parents to which the selected record will be moved.

**Insert Child Row**

To insert a child row for a record, select the three-dots menu and choose **Insert Child Row.** A new record is inserted where you can enter the details.

**Show Hierarchy**

Click on this option for any record to see its entire hierarchy.


---

# 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.fabricplan.com/powertable-sheets/how-tos/layout-views-summary/hierarchy-layout.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.
