> For the complete documentation index, see [llms.txt](https://www.boxhero.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.boxhero.io/docs/other-features/custom-analytics.md).

# Custom Analytics

Ask the AI Assistant for the inventory data you need and build custom reports beyond standard reports. Visualize as charts, save to rerun, or export to Excel.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2F8f2NEkEhdQsg9pez8Au6%2F03_Custom%20Analytics.png?alt=media&amp;token=85ad84c6-bc6f-40c3-a3e6-80facea29784" alt="Custom Analytics"><figcaption></figcaption></figure>

***

## Key Highlights

* **Ask the AI Assistant** for the inventory data you need using plain language.
* **Build custom reports** by combining conditions such as item, attribute, price, date range, partner, and more.
* **Save frequently used reports** so you can access them again anytime.
* **Restore earlier versions** of a report with built-in version history.
* **Visualize your data** with charts or export it to Excel.

## Use Cases

The standard <mark style="color:$primary;">`Inventory Reports`</mark> feature provides a quick view of key metrics like average stock quantity and inventory turnover for a selected period. Since these reports use predefined variables and formulas, they may not cover every type of report your team needs.

<mark style="color:$primary;">`Custom Analytics`</mark> gives you more flexibility to work with your inventory data. Simply ask the **AI Assistant** for the data you need, including the conditions and columns you want, and get a custom report in seconds. It's especially useful when:

* You can’t get the data you need from standard inventory reports
* You want to break data out by detailed conditions such as item, supplier, customer, or team member
* You need to compare data across different time periods, such as monthly, quarterly, or year-over-year
* You need specific data to support reporting or decision-making

{% embed url="<https://customer-0jrbilsa8yt3k758.cloudflarestream.com/962c957b64db1649124faed7790e9ce9/iframe?autoplay=true&controls=false&letterboxColor=transparent&loop=true&muted=true&poster=https://customer-0jrbilsa8yt3k758.cloudflarestream.com/962c957b64db1649124faed7790e9ce9/thumbnails/thumbnail.jpg?height=1080&preload=true>" %}

***

## How to Use Custom Analytics

### 1. Open the AI Assistant

Go to <mark style="color:$primary;">`Reports`</mark> > <mark style="color:$primary;">`Custom Analytics`</mark>.

If it's your first time, the **AI** **Assistant** will open automatically. Otherwise, click <mark style="color:$primary;">`+ New Report`</mark> to start a new report and ask the AI Assistant for the data you need.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2F1tkEUK9CKUExy7wD4Rz4%2Fcustom-analytics-new%20report.jpg?alt=media&amp;token=ee042537-ca08-4d8f-92ff-d8c6a9d50c27" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Both **admins** and **members** can create and view custom reports. You can restrict access by setting up [Custom Roles](/docs/concepts/members.md#custom-roles-and-permissions).
{% endhint %}

### 2. Request Your Data

Ask the <mark style="color:$primary;">`AI Assistant`</mark> for the data you need in plain language.

For example, enter: *"Show me last week's stock levels by category"* and the assistant will create a report based on your request.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FuApVLbVKfrsPKoqH127E%2Fcustom-analytics-ai%20assistant-question-1.jpg?alt=media&amp;token=17e162da-c125-480c-a8b7-70152de0a414" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Be as specific as possible about the **conditions** and **columns** you want. The more details you provide, the more closely the report will match your needs.
{% endhint %}

> "Show me last month's sales data."\
> "Show total units sold and sales revenue by item for last month, top 10 by revenue."

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FnNas9oAmXei5K0Da5hx4%2Fcustom-analytics-ai%20assistant-question-2.jpg?alt=media&amp;token=e0622ae8-76db-4f91-b783-742d4f9da858" alt=""><figcaption></figcaption></figure>

If you run the same report repeatedly with different search values, ask the AI Assistant to add an **input** **field**. Once added, you can enter new values each time without creating the report again.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FY5rotdlFmesjUGZHW9BB%2Fcustom-analytics-input%20field.jpg?alt=media&amp;token=1e6b3b9f-7732-440a-8cb0-6445bc91c88e" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Use **input** **fields** for values that change often, such as item names, dates, or suppliers.
{% endhint %}

### 3. Use Your Data

Results appear in a table. Click <mark style="color:$primary;">`Export to Excel`</mark> to download them, or click <mark style="color:$primary;">`Add Chart`</mark> to visualize them as a graph — bar, line, pie, stacked bar, and stacked area are all supported.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FGKTCDKf2LivE5oKusPyt%2Fcustom-analytics-results.jpg?alt=media&amp;token=62a657eb-3fd7-4bf7-8a14-3e24d741e771" alt=""><figcaption></figcaption></figure>

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FiwGxjrQuzuWlQyRiPorT%2Fcustom-analytics-chart-settings.jpg?alt=media&amp;token=db3b4037-bf14-4681-a3d3-4ea794f1e8e7" alt=""><figcaption></figcaption></figure>

Results are automatically saved to <mark style="color:$primary;">`My Reports`</mark>, so you can open and run them again anytime. If you make a change you didn't mean to, you can roll the report back to an earlier version — click <mark style="color:$primary;">`...`</mark> (more) > <mark style="color:$primary;">`Version history`</mark>.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FYOGLUDtJo9FQPI1RlO2f%2Fcustom%20analytics-my%20reports-sync-version%20history.jpg?alt=media&amp;token=bb621083-03b6-4c1d-9a55-9c1477173c59" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Your data syncs automatically **once a day**. To see the latest data, click the **sync button** (🔄) at the bottom-left before running your report.
{% endhint %}

{% hint style="warning" %}
For fields with multiple states, such as [order status](/docs/key-features/purchase-and-sales.md#purchase-order-status), the AI's interpretation may differ from what you intended. Deleted data may also be handled differently than expected. Make sure to confirm the output before using it in your work.
{% endhint %}

***

## Templates

Custom Analytics includes built-in templates that you can run right away. Try a template to see the results. If you find one useful, click <mark style="color:$primary;">`Save to My Reports`</mark> and adjust it to fit your needs.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FD55hFLgh6bZtpuqsZOSJ%2Fcustom-analytics-templates.jpg?alt=media&amp;token=f368d8d7-3a59-41d4-8490-982fdd80853b" alt=""><figcaption></figcaption></figure>

#### Examples

* Daily Total Inventory
* Weekly Transaction Summary
* Monthly Purchases & Sales Trend
* Last Tock Out Date by Item
* FIFO Inventory Valuation
* Available Inventory

***

## SQL Editing

If you're comfortable with SQL, you can edit queries directly using [DuckDB SQL](https://duckdb.org/docs/current/sql/introduction) syntax to customize a report exactly how you want.

Select a report, click the <mark style="color:$primary;">`...`</mark> button in the top-right corner, and choose <mark style="color:$primary;">`Edit SQL`</mark>.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FuRvm3pRez0cVPJVabxNv%2Fcustom-analytics-edit-SQL.jpg?alt=media&amp;token=11916f5f-552f-4423-8365-8974ebd1351d" alt=""><figcaption></figcaption></figure>

You can also add an input field by including <mark style="color:$primary;">`{{variable_name}}`</mark> in your query. For example:

```sql
select sku, name
from items
where name ilike '%' || {{item_name}} || '%';
```

This creates an **input** **field** named item\_name. Enter a keyword such as *sweater*, and the results will show every item with "sweater" in its name.

<figure><img src="https://687823928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlRf1QqJGoevCQqGbfI80%2Fuploads%2FVdQgFGRBpnXK42JGTr9r%2Fcustom%20analtyics-edit%20SQL.jpg?alt=media&amp;token=7d92eaeb-c29e-486c-8381-75c35d5dd826" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Always review your results before you rely on them.
{% endhint %}

***

## Frequently Asked Questions

**Still have questions?** Check out our Custom Analytics FAQ:

{% content-ref url="/spaces/mkYNU2xLl20GSI6NQQ6q/pages/JZKqCEfW9v3ZHGye2PVO" %}
[Custom analytics](/docs/faq/reporting/custom-analytics.md)
{% endcontent-ref %}
