> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Building a chart yourself

This chapter explains how to ask a question of your document data, turn the answer into a chart, and save it so you can put it on a dashboard.

---

## Why build one by hand

[Ask AI](/business-dashboard/ask-ai) is faster, and for most questions it is the right tool. Build a chart yourself when you need exact control over the figures: a specific filter, a particular grouping, a custom column, or a join the AI did not make.

A **question** is one saved query against your data, and it is the unit everything else is built from. A chart is how a question is drawn, a dashboard is a page of them, and an alert watches one.

One worked example runs through this chapter and the next few: **how many documents did we upload, and when.** By the end of [Alerts](/business-dashboard/alerts) that question is a chart on a dashboard, emailed on a schedule, with an alert when the count crosses a goal you set.

## 1. Starting a question

**Questions are built inside a dashboard.** There is no separate question library, so start by opening the dashboard the chart belongs on.

**If you do not have one yet**, select **New dashboard** at the top of the dashboard list and give it a name that says what it answers.

1. Open your dashboard.
2. On an empty dashboard, select **Add a chart**. On one that already has cards, select the **pencil** to edit it, then **Add questions**.
3. In the panel that opens on the right, select **New Question**.
4. The builder opens on the data step, waiting for you to choose what to ask about.

That right-hand panel also lists every question already saved in your organisation, with a **Search…** box above them. If somebody has answered your question before, add theirs instead of rebuilding it. Charts you saved from [Ask AI](/business-dashboard/ask-ai) appear in the same list.

## 2. Picking the data to start from

The picker offers two kinds of starting point, and the difference matters more than it looks.

**Data models** are the curated ones, marked **(data model)** in the list. Start from these.

| **Data model**                            | **Use it for**                                         |
| ----------------------------------------- | ------------------------------------------------------ |
| **Uploads by day (data model)**           | Volume over time: how many documents arrived, and when |
| **Document/Event Breakdown (data model)** | What happened to documents: scanned, exported, failed  |
| **Page Breakdown (data model)**           | The same picture counted in pages rather than files    |

**Tables** are everything named `Analytics …`. They are the underlying tables the models are built from, and they carry detail the models leave out. They cover documents, events, pages, queues, models, labels, exports, webhooks, accuracy and user activity. [The data behind your charts](/business-dashboard/the-data-behind-your-charts) describes every one.

**Use the search box.** The picker lists around forty entries and the three data models are not at the top, so typing a word or two of the name is faster than scrolling.

For the worked example, pick **Uploads by day (data model)**.

## 3. Joining in a second table

Upload data identifies a queue only by **Queue ID**, a number. Chart it as-is and your legend reads `41`, `57`, `63`, which nobody can act on. Joining **Analytics Queues** brings in **Queue Name**.

1. Select the **Join data** icon under the table you picked.
2. Choose **Analytics Queues** as the table to join.

**The condition fills itself in.** Staple matches **Queue ID** on both sides for you, so there is normally nothing to set. Select either side of the `=` if you need to change it.

**Most people can skip this step.** The data models already carry readable names, so the join only comes up when you have started from an `Analytics …` table.

## 4. Filtering and summarising

Raw rows are not an answer. Summarising turns them into one. The builder calls this step **Summarize**, and the control you select is **Pick a function or metric**.

1. Under **Summarize**, select **Pick a function or metric**.
2. Choose **Sum of …**.
3. Pick **Documents** as the column to sum.
4. Select **Pick a column to group by**, and choose **Event Date**.

You now have one figure per period: total documents uploaded. Add **Queue Name** as a second grouping to break that total out per queue.

**The two moves that matter.** Nearly every question is a **filter** (which rows to include) plus a **summarise** (what to do with them). Filter narrows, summarise aggregates. When a chart looks wrong, one of those two is almost always why.

The full set of functions is **Count of rows**, **Sum of …**, **Average of …**, **Number of distinct values of …**, **Cumulative sum of …**, **Cumulative count of rows**, **Minimum of …** and **Maximum of …**.

## 5. Choosing a chart type

Nothing is drawn until you ask for it. Select **Visualize** at the foot of the builder.

Match the shape to the question:

| **Question shape**                 | **Chart**                                 |
| ---------------------------------- | ----------------------------------------- |
| One number that matters on its own | **Number**                                |
| Change over time                   | **Line**, or **Area** to emphasise volume |
| Comparison across categories       | **Bar**                                   |
| Parts of a whole                   | **Pie**                                   |
| The detail is the point            | **Table** or **Pivot table**              |

The worked example is change over time, so **Line**. The current type is shown top left of the chart, and selecting it opens the full list, which also includes row, combo, waterfall, scatter and funnel.

> **A chart can take a moment to appear.** A blank panel while the query runs usually means "still working".

## 6. Saving your question

1. Select **Save**.
2. Give it a name that says what it answers. `Documents uploaded per day` beats `Query 1`.
3. Choose where it is saved.

A saved question can now go on a dashboard, which is covered in [Building dashboards](/business-dashboard/building-dashboards).

## Good to know

* **Your data is filtered to the queues your account can access.** Two colleagues can open the same question and see different numbers if they hold different queues. See [Sharing and access](/business-dashboard/sharing-and-access).
* **Daily tables hold totals, not individual documents.** **Analytics Uploads By Day** is already summed per day, so you cannot drill from it to individual documents. Start from **Analytics Documents** when you need that.
* **You can build your own calculated column** with **Custom column**, using the data already available in the tables.