Custom Analytics
Query and analyze your BoxHero data directly with SQL. You can pull the exact data you need and build custom reports you need beyond what the standard inventory report feature provides.

Key Highlights
Ask questions in plain language and the AI Assistant writes the SQL for you.
Use SQL to query your BoxHero data.
Combine conditions (e.g. item, attribute, price, date range, partner) to define the data you want to return as a custom report.
Save queries you use often and open them again at any time.
Export results to Excel for additional analysis or reporting.
Use Cases
The standard Inventory Reports feature gives you a quick view of key metrics like average stock quantity and inventory turnover for a selected period. Because those reports use predefined formulas and fields, they may not cover every type of analysis your team needs.
Custom Analytics gives you more control over how you explore your data. It’s especially useful when:
You can’t find the data you need in the standard Inventory Reports
You want to filter or group data by item, supplier, customer, team member, or other detailed conditions
You need time-based analysis such as monthly, quarterly, or year-over-year
You want to save reports you rely on and use them again
You need flexible data to support reporting or decision-making
How to Use Custom Analytics
1. Getting Started
Go to Reports > Custom Analytics. This opens a new workspace where you can create and manage your SQL queries. Then, select + New to create a new query.

2. Write a Query
You have two ways to write queries:
Use the AI Assistant to generate SQL from a plain-language question (recommended for most users).
Write SQL directly using DuckDB SQL.

Using the AI Assistant
The AI Assistant turns plain-language questions into working SQL queries. You don't need to know SQL to use it.
Type your question in the assistant panel and press enter. The assistant generates the SQL, applies it to the editor, and runs it. Results appear below the query.
You can edit the generated SQL before saving if you want to adjust anything.
Example Questions
Items below safety stock level
What hasn't sold in the last 90 days?
Top 10 SKUs by units sold this month
Open POs past their expected arrival date
Stock levels by location
Building Reusable Queries
You can ask the assistant to include adjustable filters in a query, such as date ranges or partner names. The assistant uses Query Variables so you can change the inputs later without rewriting the SQL.
For example, asking "sales by item for a date range I can change" generates a query with a date variable that prompts for input each time the query runs.

The AI Assistant works best with specific questions. Instead of "show me sales," try "top 10 items by revenue this month."
Click the Chart button to visualize the data — bar, line, pie, stacked bar, stacked area supported.
3. Save a Query
Select Execute to test your query. Since results depend on the conditions you write, review the output to confirm that it matches what you expect.
If you plan to reuse a query, select Save in the top-right corner. Saved queries appear in the left sidebar, where you can open and run them at any time.
After your query runs successfully, you can export the results with Export to Excel.

Your data syncs automatically once a day. To sync immediately, click the sync icon (🔄) at the bottom of the sidebar.
Query Variables
If you include {{variable_name}} in your query, an input field is automatically generated when the query runs. The value entered in that field is applied to the variable in your SQL query.
When you save a query, your team members can enter their own values in the variable field and run the report whenever they need it.
Example
To search for items that contain a specific keyword, enter the following query:
When you run the query, an input field named item_name appears.

Enter a keyword such as
sweaterand the results will show all items with “sweater” in their name.

Save the query if you plan to use it again. You can select and load saved queries anytime from the left-hand menu.

Examples
Custom Analytics includes built-in templates you can run right away. Review a template to understand how it works, then adjust it or create a new query based on your needs.
Templates
Weekly Stock In/Out Report
Monthly Purchase and Sales Trend
Last Outbound Date by Item

Frequently Asked Questions
Still have questions? Check out our Custom Analytics FAQ:
Custom analyticsLast updated