Skip to main content

🤖 Next Plus Report Builder: Your Personal SQL Assistant for Metabase

Written by Alex Merkin

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?