# Heatmap

<table data-card-size="large" data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th><th data-hidden></th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><a href="/pages/J4oeGu0bjBxalEVBpCBX#auto-heatmap">/pages/J4oeGu0bjBxalEVBpCBX#auto-heatmap</a></td><td></td><td></td><td></td><td><a href="/files/ErCbLFbHCwnmBgGmK54O">/files/ErCbLFbHCwnmBgGmK54O</a></td></tr></tbody></table>

## Auto Heatmap

When 2 string columns and 1 numeric column exists

```sql
-- @title: Auto Heatmap
-- @subtitle: An example auto generated heatmap comparing two categories
SELECT
Owner,
Channel,
count(*) as Sales
FROM Sales
WHERE Sales.Status = 'Won'
GROUP BY Owner, Channel
```

<figure><img src="/files/ErCbLFbHCwnmBgGmK54O" alt=""><figcaption><p>An example auto generated heatmap chart</p></figcaption></figure>

| OWNER   | CHANNEL  | SALES |
| ------- | -------- | ----- |
| Earl    | search   | 2.0   |
| Bernard | coldcall | 5.0   |
| Oliver  | event    | 3.0   |
| Oliver  | coldcall | 1.0   |
| Carrie  | search   | 9.0   |
| Norbit  | referral | 3.0   |
| Norbit  | event    | 5.0   |
| Norbit  | search   | 2.0   |
| Bernard | referral | 25.0  |
| Artie   | referral | 50.0  |
| Devon   | referral | 12.0  |
| Max     | event    | 4.0   |
| Norbit  | pr\_ad   | 1.0   |
| Carrie  | pr\_ad   | 3.0   |
| Norbit  | coldcall | 1.0   |
| Bernard | search   | 7.0   |

##


---

# 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.chartsql.com/charts/heatmap.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.
