# Ranking

One common use of conditional formatting is to highlight the top/bottom N ranked items in a report, which can help to quickly identify the most important or relevant items in the data.

Refer to the [Create Rule](/working-with-inforiver/5.-conditional-formatting/create-rule-reporting-matrix.md) section to get started. Once the rule is created and you can see the Conditional Formatting side panel, follow the steps below.

Select 'Ranking' in the **Format by** dropdown. [Learn more about using the Style section to apply formatting](/working-with-inforiver/5.-conditional-formatting/create-rule-reporting-matrix/rules-if-conditions.md#style).

* Let's apply icon-based formatting to the Top 2 subcategories based on Consumer > Sales.&#x20;

<figure><img src="/files/I1FLOTZtjgGaTN71SXNM" alt=""><figcaption><p>Conditional formatting based on ranking</p></figcaption></figure>

* You can also apply ranking based on percentages. In the sample report, the top 30% of subcategories based on Total Q2 sales are highlighted.

<figure><img src="/files/PppYhjmoG9efVc5jqfEk" alt=""><figcaption><p>Conditional formatting based on percentages</p></figcaption></figure>

* You can apply conditional formatting for the top and bottom items using the 'Both' option. In the sample report, conditional formatting has been applied based on the top and bottom subcategories.

<figure><img src="/files/irelMN7gSsE8gx5uzGuC" alt=""><figcaption><p>Conditional formatting for top and bottom sub categories</p></figcaption></figure>

* Let's create a rule for highlighting the top 2 categories. When you click Apply, conditional formatting doesn't work. This is because the category dimension is at a total level, but we have defined **Row hierarchy levels** as 'Values only'.

<figure><img src="/files/5SQyQTspdWZaRFArH2q6" alt=""><figcaption><p>Conditional formatting for totals</p></figcaption></figure>

Change the **Row hierarchy levels** to 'Values and totals' and click Apply. 'Office Supplies' and 'Technology' are highlighted now.

<figure><img src="/files/2zO6KHKgzE7fKt8ATPIx" 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.inforiver.com/working-with-inforiver/5.-conditional-formatting/create-rule-reporting-matrix/ranking.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.
