Skip to main content

πŸ€– Next Plus Report Builder: Your Personal SQL Assistant for Metabase

Alex Merkin avatar
Written by Alex Merkin
Updated over a month ago

A complete guide to generating, running, and visualizing data using Trino + Metabase


🧠 What is Next Plus Report Builder?

NP Trino is an AI chatbot custom-trained for Next Plus. It helps users:

  • Ask natural-language questions and get instant SQL answers

  • Write complex queries for Trino 450

  • Query data stored in MongoDB catalogs

  • Generate ready-to-run queries for Metabase

  • Build better dashboards, faster β€” with no SQL background required


🧰 What Can I Use It For?

You can ask NP Trino to help with:

  • Inventory reports

  • QA field monitoring

  • Work order analysis

  • Session and production metrics

  • User performance tracking

  • Maintenance & service insights

  • R&D / NPI experimentation


πŸ’¬ Example Questions You Can Ask

🟒 Beginner:

  • "Show all stock with quantity less than 10"

  • "How many sessions ran this week?"

  • "List open work orders by status"

🟑 Intermediate:

  • "Give me average torque per operator"

  • "Workflows with high rework rate"

  • "Show invalid quantity per work order"

πŸ”΄ Advanced:

  • "Compare defect rate across workflows over time"

  • "Field values out of range by user and step"

  • "Sessions longer than median duration this month"


πŸ“Œ How to Ask a Good Question

Structure your question like this:

What

How

Example

Goal

Describe your need

"I want to track invalid items"

Context

Mention table(s)

"...in workflowsessionitem"

Filters

Time/user/etc.

"...for the last 30 days"

Output

What to see

"...by user and workflow"

βœ… You don’t need to write SQL. Just describe the insight you're after.


βœ… Step-by-Step: From Problem to Dashboard

Let’s walk through a real scenario:


🧭 Problem: β€œI want to find out which users produced invalid items”


πŸ”Ή Step 1: Ask the Chatbot

Open the NP Trino Chatbot and type:

Hi, I want to see total invalid quantity per user, grouped by workflow name

The bot replies with:

SELECT "workflowname", "userid", SUM("invalidquantity") AS "total_invalid" FROM "workflowsessionitem" GROUP BY "workflowname", "userid" ORDER BY "total_invalid" DESC

πŸ”Ή Step 2: Open Metabase

  1. Log into your Next Plus Metabase

  2. Click βž• New (top right)
    ​

  3. Select SQL Query

  4. Choose your Trino MongoDB data source

  5. Paste the query you got from NP Trino

  6. Click ▢️ Run

πŸ’₯ You now see a table showing invalid totals by user + workflow


πŸ”Ή Step 3: Improve the Query (Optional)

Ask NP Trino to enhance the query:

Can you add valid quantity and calculate defect rate percentage?

It will return:

SELECT "workflowname", "userid", SUM("validquantity") AS "valid", SUM("invalidquantity") AS "invalid", ROUND(100.0 * SUM("invalidquantity") / NULLIF(SUM("validquantity") + SUM("invalidquantity"), 0), 2) AS "defect_rate" FROM "workflowsessionitem" GROUP BY "workflowname", "userid" ORDER BY "defect_rate" DESC

πŸ”Ή Step 4: Save & Visualize

  1. Click β€œSave” β†’ name your query

  2. Click + Add to Dashboard

  3. Choose visualization: Bar Chart, Table, or Line

  4. Add filters (e.g., time range, user)

βœ… Done β€” you now have a reusable chart for your team


πŸ›  Tips for Non-SQL Users

  • Ask like you talk: "Show me work orders overdue"

  • Use filters: date range, workflow, user

  • Combine: Ask for joins (e.g., get usernames instead of IDs)

  • Copy-Paste Ready: Every query from NP Trino works out-of-the-box


🎯 Example Goals by Role

Role

Questions to Ask

πŸ‘·β€β™‚οΈ Production Manager

Sessions per workflow, First pass rate, Output by SKU

πŸ§ͺ QA Analyst

Field values out of range, Average per user, Field trends

🧠 Operations

Most active users, Inactive users, SLA by WO

πŸ”§ Maintenance

Components used, RMA cycles, Service durations

πŸ›  NPI Engineer

Prototype data trends, Field deviation, Median step times


πŸ”„ Quick Commands to Try

List sessions with 0 valid quantity Work orders with no output QA field entries this week Step durations above average Most used QA fields

πŸ’‘ What Else Can NP Trino Do?

  • Explain your query line-by-line

  • Debug a failing query

  • Recommend best fields to use

  • Suggest joins and filters

  • Teach you SQL as you go

Did this answer your question?