# Single child hierarchies

With Analytics+, you can customize how you display single-node hierarchies, i.e., when a parent hierarchy has only one child. You can hide leaf nodes, hide all nodes if they are single children, or hide the parent node and display the leaf node directly if it has just one child.

## Single-child hierarchies

This option allows you to select which nodes to display when a parent hierarchy has only one child. In chart mode, this option is available under the x-axis settings > Category grouping. For tables, navigate to Canvas settings > Category grouping > Single child.

{% hint style="info" %}
This option is displayed only when the hierarchy is fully expanded.
{% endhint %}

### **1. Single-child hierarchies in charts**

{% hint style="info" %}
Single-child hierarchy options for charts and cards are identical. This section covers charts but the same applies to cards as well.
{% endhint %}

To demonstrate single-child options, let's look at a multi-level account hierarchy.

**1.1. All**

Display the hierarchy as-is with all the rows i.e. parent and single child rows.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FTncjNvAcJEz3wnKazpky%2Fimage.png?alt=media&#x26;token=f2c963c3-1946-455d-92a5-76778926decf" alt=""><figcaption><p>Single child - All</p></figcaption></figure>

**1.2. Parent only**

The leaf nodes which are single children are suppressed. This option affects only the leaf nodes. Notice how all the level 5 rows which are single children are suppressed in the hierarchy.&#x20;

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FUGCV0Kg5Jk5GypiCMrZj%2Fimage.png?alt=media&#x26;token=fd176e43-25a2-4102-b825-e980e96b74f0" alt=""><figcaption><p>Single child - Parent only</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FEDCFzocjYGekgSZQhxQ5%2FPArent%20only%20charts.png?alt=media&#x26;token=e3b0ed28-b5d5-4289-a478-00da52479f14" alt=""><figcaption><p>Levels suppressed for Parent Only option</p></figcaption></figure></div>

#### **1.3. Parent (Multi-level)**

The single child nodes at all levels (not just leaf nodes) are hidden when this option is selected - only the highest level row of the multi-level hierarchy is displayed. For Gross Revenue, IT Expenses, and Other Expenses (Level 3), notice how the Level 4 and Level 5 nodes have been hidden as they are all single-child nodes.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FXDoMWpGbk9c7mKMqCM6t%2Fimage.png?alt=media&#x26;token=9b40f1aa-34db-4f2b-af00-4359a1c88781" alt=""><figcaption><p>Single child - Parent (Multi level)</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FeUHm7fGaO0hlPSwboh8b%2FParent%20multi-level%20rows%20suppressed%20charts.png?alt=media&#x26;token=bb39f9fb-2a63-4a8e-9d96-f52204f9face" alt=""><figcaption><p>Levels suppressed for Parent (Multi level) option</p></figcaption></figure></div>

#### **1.4. Single child level as parent**

The single child nodes at the lowermost level of the hierarchy will replace their immediate parent nodes. Notice how the 'Networking' single child node at level 5 replaced its immediate parent (Infrastructure) at level 4. Similarly, under 'Other Expenses', the 'Cafeteria Costs' row at level 5 replaced the 'Miscellaneous' category at level 4. Even if the leaf node category is blank, it will still replace the parent value, like the blank category in level 5 replaced 'Gross Sales' in level 4.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FCAE5hTHjhE5cKeM4ei1S%2Fimage.png?alt=media&#x26;token=7188dcad-3f25-4db1-a9b4-18f25f1f05bd" alt=""><figcaption><p>Single child level as parent option</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fmr5XgsoOc9F62M3Emb1C%2Fchild%20level%20as%20parent%20suppressed%20row%20charts.png?alt=media&#x26;token=82ec7f1d-4961-4f90-a759-f67732ef7249" alt=""><figcaption><p>Rows suppressed with single child level as parent option</p></figcaption></figure></div>

#### **1.5. Single child as parent**

single-childWhen you have a multi-level hierarchy with single child nodes, the leaf node will replace all the parent nodes above it, provided the parent node is also a single-child nod&#x65;**.** Notice how the 'Recycled Plastic' at level 5 replaced the 'Raw Materials' category at level 3. Similarly, 'Networking' at level 5 replaced 'Infrastructure' at level 4, and 'Cafeteria Costs' at level 5 replaced 'Miscellaneous' at level 4

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F3jvUQhEK4jdDZUcRYASJ%2Fimage.png?alt=media&#x26;token=2f50e721-313b-430d-bb61-20d1459771e8" alt=""><figcaption><p>Single child as parent option</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FeUUMuxOvQ7VhKl2841FW%2FSingle%20child%20as%20parent%20rows%20suppressed.png?alt=media&#x26;token=45777708-a001-4376-a327-0f3e105928dd" alt=""><figcaption><p>Levels suppressed with Single child as parent option</p></figcaption></figure></div>

### **2. Single-child hierarchies in tables**

To demonstrate single-child options, let's look at a multi-level account hierarchy.

**2.1. All**

Display the hierarchy as-is with all the rows i.e. parent and single child rows.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FblL5ibYHPlzvQN1On6RM%2Fimage.png?alt=media&#x26;token=cd6b2c66-f2af-468d-9fd9-3c0a30da79e8" alt=""><figcaption><p>Single child - All</p></figcaption></figure>

**2.2. Parent only**

The leaf nodes which are single children are suppressed. This option affects only the leaf nodes. Notice how all the level 5 rows which are single children are suppressed in the hierarchy.&#x20;

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FG09UPPzfYaw3minIX9pY%2Fimage.png?alt=media&#x26;token=dcc27ff4-1df7-42ce-a547-754c8d408433" alt=""><figcaption><p>Parent only option</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F8ONgxMMiDL7xp5YMuscV%2FRows%20removed%20for%20parent%20option.png?alt=media&#x26;token=6c0980b7-c613-4259-a6c6-da10baaafe6a" alt=""><figcaption><p>Levels suppressed for Parent Only option</p></figcaption></figure></div>

#### **2.3. Parent (Multi-level)**

The single child nodes at all levels (not just leaf nodes) are hidden when this option is selected - only the highest level row of the multi-level hierarchy is displayed. For IT Expenses and Other Expenses (Level 3), notice how the Level 4 and Level 5 nodes have been hidden as they are all single-child nodes.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FlLRvWQPpNjD0FEazDAys%2Fimage.png?alt=media&#x26;token=5ed22696-e324-4728-83cc-f00c8eb16b76" alt=""><figcaption><p>Parent (Multi-level) option</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FJvqBMPYeVqqH7IArXdfB%2FParent%20multi-level%20rows%20suppressed.png?alt=media&#x26;token=eca69bf3-d79e-467d-97f5-1f926bf82d3f" alt=""><figcaption><p>Levels suppressed for Parent(Multi-level) option</p></figcaption></figure></div>

#### **2.4. Single child level as parent**

The single child nodes at the lowermost level of the hierarchy will replace their immediate parent nodes. Notice how the 'Networking' single child node at level 5 replaced its immediate parent (Infrastructure) at level 4. Similarly, under 'Other Expenses', the blank row at level 5 replaced the blank category at level 4

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F4UmC8GyvePTTjcITBB9q%2Fimage.png?alt=media&#x26;token=bfc2e973-209f-48eb-b0f6-0bd47031782b" alt=""><figcaption><p>Single child level as parent</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F3jYdt5QBjV5L7WXxpwzd%2FSingle%20child%20level%20as%20parent.png?alt=media&#x26;token=a0f9daeb-75f3-4fbe-8372-4ff6eb192ac3" alt=""><figcaption><p>Levels suppressed for single child level as parent option</p></figcaption></figure></div>

#### **2.5. Single child as parent**

When you have a multi-level hierarchy with single child nodes, the leaf node will replace all the parent nodes above it, provided the parent node is also a single-child nod&#x65;**.**

Let's consider a slightly different account hierarchy to demonstrate this option. 'Gross Profit' and 'Operating Expenses' have 3 levels of single children under them.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FOWmOqfE2DZO3caQxNRO5%2Fimage.png?alt=media&#x26;token=92551f02-3151-4731-b203-8e83f910e3ad" alt=""><figcaption><p>Single child account hierarchy will 'All' option</p></figcaption></figure>

The parent nodes at level 4 and level 3 have been replaced by the child nodes at level 5.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F7l0mS8MEn8QA6Xbb8DhG%2Fimage.png?alt=media&#x26;token=5a28db5d-8b89-44c3-a7dd-c1d8d059582c" alt=""><figcaption><p>Single child as parent option</p></figcaption></figure>
