Case study · Wine and food distribution, capital group
One sales figure instead of three.
We combined two Comarch ERP XL databases, Logifact WMS, Symfonia and base.com into one data warehouse. Grupa MJG has about 80 Metabase reports, refreshed every hour and matching the ERP to the cent.
- Client
- Grupa MJG case study
- Scope
- ERP

The client’s question
How much did we really sell last month, and why does every report say something different?
Grupa MJG is a wine and food distributor. Vininova imports wine and sells it wholesale to restaurants and stores, and runs a chain of brick-and-mortar stores and a loyalty club. Index Food supplies food to retail chains and independent stores, and also runs an online store and a delicatessen. The companies have separate Comarch ERP XL databases and a shared warehouse running Logifact WMS.
Reports had been built over the years in several places: in Comarch BI Point (several hundred reports), in SQL queries emailed by n8n, and in spreadsheets. For the same month, three tools showed three different sales totals, with a difference of almost 2%. No one knew which one was right. Sales reps were held accountable for figures that could not be reproduced.
The whole project in 90 seconds
Where the three different figures came from, how they became one, and what reports the board, sales reps, purchasing and stores got.
The video is in Polish. Data in the screenshots shown in the video is anonymized.
How we did it
Numbers first, charts second
We built the first chart only once we knew where the differences between the tools came from.
01 Auditing the numbers before the first chart
We calculated sales for one closed month directly in the ERP and compared them with the results from BI Point and the n8n reports. We broke every difference down into its components: invoices issued from goods issue notes (WZ), services, free goods, exports, cost corrections, document dates. The differences came from definitions, not from errors in the data.
02 A decision sheet instead of guesswork
We showed each difference on real ERP documents, with the amount involved. The client decided on 13 points, for example whether sales are counted by sale date or issue date, which sales rep a customer is assigned to, and what to do with free goods. These decisions are written into the warehouse code and into the user help.
03 A data warehouse with the rules in one place
Data from both Comarch ERP XL databases, Logifact WMS, Symfonia (the online store) and base.com (orders from Allegro and online stores) goes into a PostgreSQL warehouse every hour. The business rules live in dbt models and nowhere else: sales channel, sales rep, margin, inventory turnover, receivables. We connect to the source systems read-only.
04 Reports for every department in Metabase
On top of the warehouse, we built about 80 dashboards: for the group board, the sales director, sales reps, purchasing, stores, the warehouse and marketing. Everyone sees only their own company and their own scope. The reports are stored as code, so a change to a metric definition reaches every report at once.
What we connected
Six sources, one warehouse, reports for every department
Each source has its own folder at every stage: data extraction, warehouse rules, reports. Reports that combine both companies have a separate group schema, in which intra-group sales are counted separately.
The sales department uploads the sales plan itself, as a CSV file straight into Metabase.
- Comarch ERP XL Vininova
- Comarch ERP XL Index Food
- Logifact WMS
- Symfonia Handel
- base.com
- Sales plan in CSV

- 6
- source systems
- Two Comarch ERP XL databases, Logifact WMS, Symfonia Handel, base.com and CSV files with the sales plan.
- about 80
- dashboards
- More than 1,200 questions (tiles) in Metabase, for two companies and the group board.
- 185
- dbt models
- Business rules written once, with tests and a description of every field.
- 10 days
- to the first full set
- From the first commit to sales, purchasing and warehouse reports and the group board cockpit. After that, we develop the reports together with the departments.
Sales reps
Who owns the sales when a customer changes account managers?
The old reports assigned sales to the customer’s current account manager. When customers were reassigned, the history jumped: one sales rep had zero in the past, another several dozen percent more.
Now the sales rep is the account manager recorded on the document at the time of sale. The history does not change, and team results can be compared year over year. Data in the screenshot is anonymized.

A report that arrives on its own
Every Monday at 8:00 a.m., each sales rep gets their region
Month-to-date sales, a year-over-year comparison, customers to win back and the portfolio structure. Only for their region, by email, easy to read on a phone.
The sales rep does not need a system account for this. Data in the screenshot is anonymized.

Board
The group board sees cash, not just sales
The group cockpit combines sales of both companies (excluding intra-group sales), receivables, payables, inventory and cash flows for the next 7, 30, 60 and 90 days.
Next to it is working capital, with receivables, inventory and payables turnover. Data in the screenshot is anonymized.

What changed in the company
Every department has its own reports, calculated the same way
One definition of sales
The board report, the sales rep report and the store result count the same thing in the same way. When the definition changes, it changes in one place.
Purchasing sees turnover and risk
Days of inventory per product, low-stock and overstock alerts, batch age, expiry risk and supplier on-time delivery.
Stores and the Club
Each store sees its results day by day, supplies from headquarters and club member activity. The board sees store results with costs from the ledger.
Your own questions without SQL
Employees build their own reports in the Metabase query builder, on the same verified tables. Every field has a description in the help.
Permissions per company and department
24 accounts in 18 permission groups. The board of one company cannot see the other, and board reports are in separate collections.
Data time on every report
Every dashboard has a “Data as of” tile with the time of the last extraction. Hourly refresh from 7:00 a.m. to 10:00 p.m., full recalculation at 6:00 a.m.
Purchasing
Will this product sell before it expires?
Index Food sees batches with their expiry dates and a sell-through forecast at the current sales pace. Batches at risk of expiring go on an action list before they become a loss.
Data in the screenshot is anonymized.

Stores
Each store’s results day by day
Sales in Vininova’s brick-and-mortar stores, average receipt value, club members buying in store and the weekly pattern. Next to it, the board has store results with costs from the ledger (cost centers).
Data in the screenshot is anonymized.

to the centmatch with the ERP
We check every definition change with a query run directly against Comarch ERP XL for a selected month. Vininova’s receivables and both companies’ payables, including import invoices in foreign currency, match to the cent. Sales for three full years differ by a few PLN per year at most, due to rounding when split across warehouses.
We record the result of every reconciliation (period, amounts, difference) in the project documentation. After every refresh, an automated check opens every tile of every dashboard, so we see a broken report before users do.
Self-service
Employees ask their own questions
The Metabase query builder works without SQL: table, filter, summary, chart. You can open and drill into any dashboard tile and save the result as your own question.
The query builder works on the same tables as the ready-made reports, so your own report shows the same numbers.

Implementation status, November 7, 2026
Live, in progress, next steps
Live
The warehouse and about 80 dashboards
Six sources, 24 accounts in 18 permission groups, 40 email subscriptions, weekly sales rep reports and help describing every metric.
In progress
Sales plan and actuals
The 2026 wholesale plan is uploaded, the store plan is in preparation. Plus a warning about outdated data on dashboards.
Next steps
Discounts, portfolio from CRM, new sources
Discount from the channel price list, the sales rep portfolio from CRM, and further sources as systems in the group change.
Reporting and BI




