# Agency Comparison

Agency Comparison lets you place up to three educational agencies side by side and review their key metrics at a glance. Instead of navigating between separate agency pages, you select the agencies you want to examine, and all of their data appears in one view. You can switch between a card layout and a table layout depending on whether you prefer a visual summary or a structured row-by-row breakdown.

## Contents

* [What You Can Compare](#what-you-can-compare)
* [Selecting Agencies](#selecting-agencies)
* [Card View](#card-view)
* [Table View](#table-view)
* [Switching Between Views](#switching-between-views)
* [Removing an Agency](#removing-an-agency)
* [Troubleshooting](#troubleshooting)

***

## What You Can Compare

Agency Comparison surfaces data across several categories for each selected agency. The specific metrics available depend on your organization's configuration, but common categories include:

| Category    | Example Metrics                                     |
| ----------- | --------------------------------------------------- |
| Enrollment  | Total student enrollment, year-over-year change     |
| Performance | Graduation rate, attendance rate                    |
| Academic    | Proficiency rates in reading and math               |
| Financial   | Per-pupil expenditure                               |
| Staffing    | Student-teacher ratio, number of certified teachers |

Numeric metrics show a trend indicator — an upward arrow for improvement, a downward arrow for decline, or a right-pointing arrow for a stable value — wherever trend data is available.

***

## Selecting Agencies

The selection panel appears at the top of the Agency Comparison page. It contains three labeled slots (Agency 1, Agency 2, Agency 3) and a dropdown for adding agencies.

**To add an agency:**

1. Open the **Add Agency to Compare** dropdown.
2. Choose an agency from the list. Only agencies not already selected are shown.
3. The agency fills the next available slot and its data loads immediately.

Each slot is visually color-coded:

* **Agency 1** — blue
* **Agency 2** — green
* **Agency 3** — orange

These colors carry through to both the card and table views so you can always match a column of data back to the corresponding agency.

Once all three slots are filled, the dropdown is disabled and a note appears confirming the maximum has been reached. You must remove an agency before you can add a different one.

***

## Card View

Card view is the default layout when agencies are first selected. Each agency occupies its own column, with a colored header showing the agency name. Underneath the header, the agency's metrics are presented as individual data cards grouped by category.

Each data card shows:

* **Metric name** — displayed in small uppercase text at the top of the card.
* **Value** — displayed in large bold text. Numbers are formatted automatically (for example, currency values show a dollar sign, percentages show a percent symbol).
* **Trend indicator** — if trend data is available, a colored label below the value shows whether the metric is trending up (green), down (red), or stable (yellow).

When an agency has metrics in more than one category, a category heading separates each group of cards within the column. This makes it easy to compare, for example, all three agencies' Academic results without having to scan through unrelated rows.

On screens narrower than 992 pixels, three-column layouts reflow to two columns. On mobile screens, each agency's column stacks vertically.

***

## Table View

Table view arranges the same data in a structured grid. Each row represents a single metric; each column after the first represents one of the selected agencies.

The table header row is sticky — it remains visible as you scroll down through a long list of metrics, so the agency names stay in view at all times.

Within each data cell:

* The formatted value is shown in text.
* A trend icon appears next to the value when trend data is available (green arrow up, red arrow down, or amber arrow right).
* A proportional bar underneath the value gives a quick visual sense of scale relative to the highest value for that metric across all selected agencies. The bar color matches the agency's assigned color.

When metrics span more than one category, a shaded divider row with the category name separates each group in the table. If all metrics belong to a single category, the divider row is omitted.

The table scrolls horizontally on smaller screens so no data is clipped.

***

## Switching Between Views

The view toggle appears in the top-right area of the page, but only after at least one agency has been selected.

* Click **Cards** (grid icon) to switch to card view.
* Click **Table** (table icon) to switch to table view.

The active view is highlighted. Your selected agencies remain unchanged when you switch views — the same data is simply presented in a different layout.

***

## Removing an Agency

To remove an agency from the comparison, click the **X** button in the top-right corner of that agency's slot in the selection panel. The slot returns to an empty state and the agency's column disappears from both views immediately.

After removing an agency, the dropdown becomes active again (if it was disabled at the three-agency limit) so you can add a replacement.

***

## Troubleshooting

**The dropdown is grayed out and I cannot add another agency.** You have already selected three agencies, which is the maximum. Remove at least one agency using the X button on its slot before adding another.

**An agency I expect to see is not in the dropdown list.** The dropdown only shows agencies that are not already selected. If the agency is already in one of the three slots, it will not appear in the list. If you believe the agency should be available but cannot find it at all, contact your administrator to confirm your account has access to that agency.

**A metric shows "--" instead of a value.** A double dash indicates that no data is available for that metric for the selected agency. This can occur when data has not yet been loaded for the current reporting period or when the metric is not applicable to that agency type.

**I expected to see trend indicators but none are shown.** Trend indicators only appear for metrics where trend data has been provided. If no trend arrow is visible for a particular metric, that metric does not have year-over-year or period-over-period data available in the current dataset.

**The page shows "No Agencies Selected" even though I chose an agency.** If the comparison data is still loading, a spinner is displayed in place of the views. If the spinner has cleared and the empty state message is still visible, try selecting the agency again using the dropdown. If the problem persists, refresh the page and retry.


---

# 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://nimble.docs.otised.com/guides/agency-comparison.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.
