LNData
Back to portfolio Client · Scotti Distribuidora

Sales, DC and finance, on one set of numbers.

I’m designing and building, from scratch, Scotti Distribuidora’s corporate BI — a distributor and importer based in Criciúma, Santa Catarina. The platform reads the ERP and the WMS without writing a single row to them, rebuilds the sales BI the company already used while checking every number, and brings the distribution center’s shipping and finance — which had never been in the BI — into the same base. It all runs on Scotti’s own server, with the code and documentation handed over to them.

Role · Architecture, reverse engineering, data engineering, BI and applied AI
Scope · End-to-end project · in progress (4 months)
In short, for decision-makers
The problem

Scotti’s sales BI ran outside the company and covered only sales. DC shipping and finance were left out, each in its own system’s reports.

What LNData did

We built, on Scotti’s own server, a platform that reads the ERP and the WMS, rebuilds the sales BI with the same rules, checked number by number, and brings shipping and finance into the same data model. The final stage is AI: questions in plain language, inside the BI screen, with the asker’s permissions.

So far

The numbers from before, now explained down to the last difference — and, on the same screen, what the BI never showed: picking and checking at the DC, accounts receivable and payable, delinquency and average terms. No per-user license and no middleman between the ERP and the dashboard.

Scotti Distribuidora
Criciúma, SC
distribution and import
since 2014
sales history in the BI
ERP + WMS
read with no writes at all
3 areas
sales, DC and finance
+100M
records in the data warehouse
126
charts across 3 dashboards
123
KPIs cataloged, each with its formula
13 × 144
measures × months checked against the previous BI
The engineering behind it — for those who want the technical detail

Architecture

The platform reads the ERP and the WMS, applies the business rules in a layered analytical data warehouse and delivers the result in BI dashboards and, in the final stage, in an AI chat inside the screen itself. Fully containerized, on the client’s server, behind HTTPS.

Source systems
  • ERP (sales and finance)
  • Distribution center WMS
  • Previous BI (for checking only)
Data platform
Pipeline orchestration
Layered analytical data warehouse
Client server · HTTPS · read-only on sources
Consumption
  • BI dashboards · sales, DC and finance
  • AI chat in the BI screen · final stage
  • Email alerts · load failure and certificate

Areas covered

From the sales rep’s order to the paid invoice, each area read from the source and placed in the same data model, with the same customer, product and team filters.

Sales

The sales BI, rebuilt from the inside

Seven screens — period with business-day projection, sell-out, sales team, targets, products, customers and year-over-year comparisons — with the previous BI’s rules reproduced.

Distribution center

Picking, checking and productivity

Picking and checking time per order, productivity per operator and what is open right now, read from the WMS without getting in the way of operations.

Distribution center

Receiving and occupancy

Receiving with blind check, time to put-away and warehouse occupancy by location type.

Finance

Receivables and payables in one place

Accounts receivable and payable by due-date bucket, delinquency by customer and business group, average collection and payment periods.

History

What the systems don’t keep

The WMS keeps only today’s balance: the load saves a daily snapshot of occupancy. In finance, the position at any month-end is rebuilt from the settlements, to the cent.

Returns

Linked to the original sale

Each partial return linked to the original sales invoice, the basis for separating gross and net revenue.

Replicate exactly, and explain every difference

Before showing any new screen, the BI the company already used was rebuilt and checked against itself, with the old model opened up and the measures calculated directly in it.

Three levels of checking

Base measures compared month by month across the whole history, a closed month broken down by 18 dimensions, and every chart on the sales screens against its counterpart.

Even the rules nobody wrote down

Rules the previous BI applied without documenting them, such as the business day that doesn’t discount holidays, were reproduced and recorded in the KPI catalog.

Targets checked pair by pair

The value of sales targets matches in 17,868 of 17,873 target × sales-rep pairs.

Product · LNData Superset

BI with AI inside the screen

The dashboards run on the Apache Superset distribution maintained by LNData, licensed to Scotti with no per-user cost. In the project’s final stage, it gets an AI chat inside the screen itself and an MCP server: the AI queries the BI authenticated as the person who asked, with the same permissions and the same audit trail.

Dashboards as code

Each dashboard is described in code, versioned and re-imported. What is in the repository is what is on screen, and changes made by hand don’t survive.

No one sees through the AI what they wouldn’t see on the dashboard

Row-level security by org chart in the BI and, as a second layer, in the database itself. The AI inherits the scope of whoever asks.

AI cost under control

Daily cap per user, data limit per question, monthly cap with an alert and a usage-and-cost dashboard inside the BI itself.

No per-user license

Open source and the LNData distribution with no monthly fee: adding one more person to the BI doesn’t change the bill.

Apache Superset 6.1MCPClickHousePython

Impact

The sales BI moves to Scotti’s own server, with automatic loads and failure alerts, and no middleman between the ERP and the dashboard.

Shipping and finance, which had never been in the BI, sit in the same model as sales, with the same customer, product and team filters.

The history the systems don’t keep — warehouse occupancy day by day and the receivables position at each month-end — now exists.

Code, documentation and architecture decisions stay with the client: no black box.

Platform stack

AirflowClickHouseSupersetPythonMCPDockernginx

A BI that needs to come back in-house?

From reverse engineering the BI you already use to AI that respects each person’s permissions — tell us what you need to solve and we’ll come back with scope, timeline and deliverables.

Talk to LNData