> For the complete documentation index, see [llms.txt](https://docs.phocassoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phocassoftware.com/flex-modes/create-a-nested-view.md).

# Create a nested view

Use a nested view to group related dimensions into levels so you can explore your data from a high-level summary down to more detailed results. Expand each level in the grid to see how the data beneath it contributes to the overall result.

{% embed url="<https://phocassoftware.wistia.com/medias/rv1udi0v3c>" %}
Create a nested view
{% endembed %}

The order of the dimensions in the **Nest view** determines the hierarchy in the grid. The first dimension is the highest level and the last dimension is the lowest level. A nested view must contain at least two dimensions and can contain up to six.

For example, you might create a nested view with Product Class, Product Sub Class, and Product. The grid initially shows Product Classes. You can then expand a Product Class to see its Product Sub Classes, and expand again to see the individual Products.

To create this nested view:

1. In the Dimensions panel, locate the **Nest view** dropzone.
2. Drag **Product Class** from the Dimensions list into the **Nest view** dropzone.
3. Drag **Product Sub Class** into the dropzone below Product Class.
4. Drag **Product** into the dropzone below Product Sub Class.
5. Drag the dimensions within the dropzone if you want to change their order.

<div align="left"><figure><img src="/files/CgXJfWf6clgfla2G7990" alt="" width="563"><figcaption></figcaption></figure></div>

The same steps apply to any dimensions you want to use in a nested view.

### Expand or collapse levels

Select the expand or collapse button next to a row to show or hide the next level of data.

The blue bar on each dimension in the **Nest view** dropzone shows how much of that level is currently visible in the grid:

* A full blue bar indicates that the level is visible in the grid.
* A partial blue bar indicates that only some of the data at that level is visible, such as when you expand an individual row.
* No blue bar indicates that the level is not currently visible.

<div align="left"><figure><img src="/files/VaKwVsBZrWhLLkwJ6WN3" alt="" width="563"><figcaption></figcaption></figure></div>

As you expand and collapse rows, the indicators update to reflect the levels currently displayed.

#### Change a nested view

Change the dimensions or their order at any time.

* **Add a level:** Drag another dimension into the **Nest view** dropzone.
* **Remove a level:** Select **X** on the dimension you want to remove from the **Nest view**.
* **Change the hierarchy:** Drag the dimensions within the dropzone to reorder them.

The grid updates automatically when you change the nested view.

### Switch between views and modes

You can select another dimension without removing your nested view. To return to it, select **Nest view**. The dimensions and their order remain in place, so you don't need to rebuild the hierarchy.

<div align="left"><figure><img src="/files/bTM8ixMnkasRVXPkCHlL" alt="" width="375"><figcaption></figcaption></figure></div>

Your nested dimensions are also retained when you [switch modes](/flex-modes/customize-your-view/switch-modes.md), where those selections are supported. Other selections, such as measures, streams, periods, and properties, are also retained where possible. If a selection isn't available in the mode you switch to, it isn't carried over.

### Change the properties

The **Code** and **Name** properties display by default for dimensions in a nested view. You can [change the other properties](/flex-modes/customize-your-view/change-the-properties.md) displayed in the grid, depending on how your database has been configured.

You cannot turn off the **Code** property in a nested view because it is required to maintain the relationship between the nested rows.

### Focus on data

Select one or more rows in the top level of the nested view and [focus](/flex-modes/filter-data/focus-or-exclude-data.md#focus-on-data) on them to display only those entities and their nested data.

You can then expand the focused rows to explore the lower levels of the hierarchy.

Filters applied to your data are also reflected in the nested view.

### Continue working with a nested view

You can continue working with your data while a nested view is selected. For example, you can:

* [change the mode, period, measures and properties](/flex-modes/customize-your-view.md)
* [sort the data](https://docs.phocassoftware.com/flex-modes/pages/H6L4oa6sWXOlwizIA8X9#id-1.-sort-data)
* [apply filters](/flex-modes/filter-data/search-for-data.md#filter-from-the-grid)
* [reorder and resize columns](/flex-modes/manage-columns.md#resize-columns)
* [save your analysis as a favorite](/flex-modes/save-and-share-favorites.md)
* [copy or export the data](/flex-modes/copy-or-export-data.md)

When you export a nested view to XLSX, the nested row structure is retained and the rows are expanded by default.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.phocassoftware.com/flex-modes/create-a-nested-view.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
