> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/compare-support-backlog-by-status-and-priority.md).

# Compare Support Backlog by Status and Priority

Build a Stacked Column chart of open Cases by status and priority, then normalize each stack to compare priority mix as well as backlog size.

A support lead needs to see where open Cases are waiting and how much of each status is High priority. Build an Avonni Stacked Column chart for the counts, then normalize it to compare priority proportions. Keep the raw counts available when judging workload.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fal8N041PEh63wwdkyd1b%2Ftutorial-stacked-cases-result.jpg?alt=media" alt="Stacked Column chart preview showing open Case counts by status and priority"><figcaption><p>Builder preview of 12 open Cases, grouped by status and split by priority.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fal8N041PEh63wwdkyd1b%2Ftutorial-stacked-cases-result.jpg?alt=media)

## Before You Start

* Open a Dynamic Component you can edit and use Case records you can read.
* Confirm your org's Status and Priority values. This sample uses `New`, `On Hold`, `Escalated` and `Closed`, with `High`, `Medium` and `Low` priorities.
* Use a sandbox for sample Cases. You need Status, Priority, record ID and the closed flag (`IsClosed`).
* See the [Chart reference](https://docs.avonnicomponents.com/dynamic-components/components/chart.md) and [Query guide](https://docs.avonnicomponents.com/dynamic-components/component-builder/data-sources/query.md).

## Steps

{% stepper %}
{% step %}

### Count the Backlog Before Building

Prepare these twelve open Cases with Subjects starting with `Chart Docs Cases -` , or calculate the same table for your own records.

| Status    | High | Medium | Low | Open total |
| --------- | ---- | ------ | --- | ---------- |
| New       | 3    | 2      | 1   | 6          |
| On Hold   | 1    | 2      | 1   | 4          |
| Escalated | 2    | 0      | 0   | 2          |

Add one `Closed` Case with `High` priority under the same prefix to test its exclusion. The expected open backlog remains `12`.

Your org may use different status values or a different closed status. Verify the records' `IsClosed` values rather than assuming a status label alone proves whether a Case is open.
{% endstep %}

{% step %}

### Query Open Cases

Add **Chart** from the **Component Library**. In **Edit Chart > Properties > Content**, set **Type** to **Stacked Column** and **Title** to `Open support cases by status`.

Set **Data Source** to **Query**. In **Records**, choose or create a Case query. Use **Edit the query** to combine these conditions with AND:

* The closed flag is false (`IsClosed = false`).
* Subject (`Subject`) starts with `Chart Docs Cases -` .

For your operational chart, replace the subject condition with your team's scope. Keep the open-only condition and calculate your comparison table using the same accessible records.
{% endstep %}

{% step %}

### Map Status, Priority and the Case Count

Open **Data Mappings** and set these three entries:

| Mapping      | Field                 | Measure and display                                            |
| ------------ | --------------------- | -------------------------------------------------------------- |
| Bars         | Status (`Status`)     | Group by the status value                                      |
| Bar Segments | Priority (`Priority`) | Split each status by priority                                  |
| Bar Length   | Record ID (`Id`)      | Measures: Count, Format Style: Number Rounded, Multiplier: `1` |

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FATT8a9gAUxR3Rq2o1zVi%2Ftutorial-stacked-cases-mappings.jpg?alt=media" alt="Stacked Column mappings for Case status, priority and count" width="320"><figcaption><p>Map status to Bars, priority to Bar Segments and the Case count to Bar Length.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FATT8a9gAUxR3Rq2o1zVi%2Ftutorial-stacked-cases-mappings.jpg?alt=media)

Turn on **Show Legend**. Its entries pair status with priority, such as `New - High`. The sample has seven entries, one for each populated status-and-priority pair. Leave **Normalize Values** off for the first check. Set **X Title** to `Status` and **Y Title** to `Open cases`.

Count `Id` to count Cases. Counting a field that is blank on some records can obscure what your measure represents.
{% endstep %}

{% step %}

### Verify the Raw Counts

Click **Preview**. Compare each stack with the source table: New totals `6`, On Hold totals `4` and Escalated totals `2`.

Check the segments too. The High counts are `3`, `1` and `2` respectively. The three stack totals must add to `12`, and the closed control must not appear.

Use the combined status-and-priority legend labels and available tooltips to identify each segment. A priority does not have a guaranteed permanent color across statuses or chart changes.
{% endstep %}

{% step %}

### Normalize to Compare the Priority Mix

Return to the editor and turn on **Normalize Values**. Change **Title** to `Open support priority mix` and **Y Title** to `Share of open cases`.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FUgaxSGaxW6vBdXBKUrg8%2Ftutorial-stacked-cases-normalized.jpg?alt=media" alt="Normalized Stacked Column chart preview showing each status priority mix"><figcaption><p>Builder preview with normalized values, comparing each status's priority mix.</p></figcaption></figure>

[View this capture at full size](https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FUgaxSGaxW6vBdXBKUrg8%2Ftutorial-stacked-cases-normalized.jpg?alt=media)

Open **Preview** again. Each nonempty status now represents 100% of its own Cases. The expected High shares are `3 / 6 = 50%` for New, `1 / 4 = 25%` for On Hold and `2 / 2 = 100%` for Escalated.

Normalization changes the comparison, not the underlying records. Escalated has the highest High-priority share while holding only two Cases. Equal stack heights do not mean equal workloads. Rounding can affect the displayed percentages for thirds or sixths.
{% endstep %}

{% step %}

### Save the View and Check Its Meaning

Choose raw counts for backlog size or normalized stacks for priority mix. Keep the matching title and click **Save**. Verify the three totals or three High shares once more in **Preview**.

The figures show the Builder preview. Before sharing on a Lightning Page, follow [Publishing your Dynamic Components](https://docs.avonnicomponents.com/dynamic-components/core-concepts/publishing-your-dynamic-components.md) and check the query with the intended viewer's access.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Closed Cases appear in the chart</summary>

Check `IsClosed = false` and the sample-subject scope in the query. Confirm the control record is actually closed in your org. A status name is not a substitute for checking its closed flag.

</details>

<details>

<summary>Each priority appears as a separate column</summary>

Check **Type** is **Stacked Column**. Map Status in **Bars** and Priority in **Bar Segments**. Reversing those groupings answers a different question.

</details>

<details>

<summary>Every column has the same height</summary>

Check **Normalize Values**. Turn it off to compare absolute Case counts. Leave it on only when the audience needs each status's priority proportions, and use a title that states that purpose.

</details>

## Related Tutorials

* [Compare Total and Average Deal Size](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/compare-total-and-average-deal-size.md): compare different measures over a shared set of records.
* [Compare Won Revenue by Lead Source](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/compare-won-revenue-by-lead-source.md): see how a different denominator changes a share comparison.
* [Select an Account to Filter Its Pipeline Chart](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/select-an-account-to-filter-its-pipeline-chart.md): let a selection change which records a chart includes.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chart/compare-support-backlog-by-status-and-priority.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
