> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Top N analysis

> Top N analysis shows only the top or bottom N items in a chart — focus on what matters, simplify dense data views, decide faster.

## Overview

Dashboard charts support **Top N analysis** — show only the "top N" or "bottom N" items to focus on what matters, simplify dense views, and decide faster.

### Common scenarios

* **Sales analysis**: see the top 10 products by revenue — pinpoint core SKUs fast.
* **Cost control**: surface the bottom 5 regions by profit — flag problem areas early.

## How to use

### Prerequisites

Before using Top N, confirm your permissions:

* **Advanced permissions on** → admin/owner only.
* **Advanced permissions off** → anyone with edit or manage permissions (including admin/owner).

### Enable Top N

1. In the dashboard, select the chart to configure — open the config panel.

2. In the config panel on the right, click the **Analysis** tab.

3. Find **Top N** — toggle it on.

### Configure ranking rules

#### 1. Pick a ranking method

Available ranking methods depend on chart type:

* **XY-axis charts (column / line / bar / area / combo / radar / scatter)**

  * **Rank by category sum**: rank categories (e.g., "product category") by total value.
  * **Rank by series value**: rank by a specific data series (e.g., "profit").
  * **Rank by series within each category**: rank series independently inside each category.
  * **Rank by series sum**: rank series by their total across all categories.
* **Pie / donut chart**

  * Fixed to **rank by sector value** — compare each slice directly.

#### 2. Set how many to keep

* **Direction**:
  * **Top N**: show the N highest values.
  * **Bottom N**: show the N lowest values.
* **Count**: enter a positive integer (e.g., `10`, `5`).

### Disable Top N

Click the **Top N** toggle again — the chart restores all data.

## FAQ

#### Q: Why can't I use Top N?

A: Confirm you have **admin** or **owner** permission on the table. If advanced permissions are off, you need **edit** or **manage** permission on the chart.

#### Q: After enabling Top N, the chart shows less data — is data lost?

A: No. The data is just temporarily filtered out. Toggle Top N off and all data reappears.
