Skip to content

Data warehouse for a mid-sized company: where to start

B2Bnetwork team · · 6 min

Integrations, data and cloud

In brief

A data warehouse in a mid-sized company starts with a list of a dozen or so questions that management currently waits days to answer, not with choosing a tool. The first stage covers one area, usually sales and margin or receivables, two or three sources and a star schema model. A relational database on the company's server or in the cloud is enough, with nightly incremental loads and daily snapshots of balances the ERP does not keep. The first reports should be running after about three months.

Why a warehouse when the ERP has reports

An ERP shows the current state and answers questions about individual documents well. It struggles with four things that come back every month in a mid-sized company:

  • combining sources: sales from the ERP, freight costs from the carrier's system, the budget from a spreadsheet, complaints from the CRM;
  • history of balances: what overdue receivables were on March 31, when the ERP only shows today's balance;
  • one definition per metric: margin calculated the same way in the board report and in the sales team's report;
  • system load: heavy analytical queries do not slow down the ERP during working hours.

If none of these problems apply to you, the warehouse can wait. If the monthly report takes several days to build by hand and two people quote two different figures, it is time to start. Where the different figures come from is explained in ERP reports don't match.

Step 1: questions, not tables

The most common mistake is copying every ERP table into a new database and calling it a warehouse. Instead, write down the questions asked at management meetings and give each one an owner.

QuestionMetricSourcesOwner
Which customers make us money and which lose it?margin per customer after freightERP, carrier systemsales director
How is the age of receivables changing?overdue receivables by aging bucketERPCFO
Which products tie up cash?inventory turnover in daysERP, WMSlogistics manager
How are sales tracking against budget?sales and margin vs planERP, budget spreadsheetmanagement board

A dozen or so questions like these define the scope of the first stage. The metric owner signs off its definition: what counts as sales (credit notes, returns, intercompany sales), by which date and in which currency.

Step 2: three layers and a star schema

A small warehouse needs a simple but consistent structure:

  1. Raw layer. Copies of source tables, unchanged, with a load date. It lets you trace any figure and reload data after fixing logic.
  2. Clean layer. Shared dictionaries: one customer, even though the ERP and CRM use different IDs, one product list, one calendar, currency conversion.
  3. Reporting layer. Star schemas: a fact table (invoice lines, stock movements, payments) surrounded by dimensions (customer, product, date, sales rep, branch). Power BI or another reporting tool runs on top of it.

The dimensional model described by Ralph Kimball has been the standard for such layers for years, because queries stay simple and a new source adds another fact table that reuses the same dimensions. Two techniques from this model prevent the most arguments:

  • periodic snapshots: every day you record the balance of receivables, inventory and open orders, because the ERP overwrites these values and after a month they cannot be reconstructed;
  • history of dimension changes: when a customer moves to another sales rep, old sales stay with the previous rep and new sales go to the current one.

The choice between transforming data before or after loading is covered in ETL or ELT.

Step 3: tools and size

A mid-sized company rarely has "big data". A worked example: 300,000 invoice lines a year over five years, plus stock movements and payments, is a few million rows and a few gigabytes of data. An ordinary relational database handles that, for example PostgreSQL on the company's server or as a managed cloud service. Big data platforms make sense for machine data, store clickstreams or logs, not for commercial documents alone.

DecisionSimple startWhen to change
Databaserelational, on your server or as a cloud servicewhen reporting-layer queries take minutes despite indexes
Loadingnightly, incremental by modification datewhen you need data during the day: change data capture
TransformationsSQL in a repository, with data testskeep it
Reportsone semantic model in Power BIkeep it

Whatever the tools, keep transformations in a repository as SQL code, with tests: no duplicate invoices, sales totals matching the ERP, every fact row has a customer and a product.

Step 4: the first 90 days

  • Weeks 1–3. The question list, metric definitions with owners, access to sources (ideally a database copy or read-only views, not the ERP admin account).
  • Weeks 4–8. Raw and clean layers for two or three sources, the first star schema, daily snapshots of balances.
  • Weeks 9–12. Power BI reports on one model, reconciling totals with the ERP, a review with metric owners, retiring the first manual spreadsheet.

The measurable result of the first stage is not the number of tables but a monthly report that is no longer built by hand, and a figure management has stopped questioning. How to build the model and permissions in Power BI is covered in Power BI implementation.

Pitfalls that drag the project out

  • The whole company at once. Five areas in the first stage means that after six months none of them works.
  • Spreadsheets as a source. A budget in a spreadsheet is fine if it has a fixed layout and an owner. Ten spreadsheets with manual adjustments must first become one table.
  • No owner for definitions. The IT team should not decide alone whether margin is calculated before or after retrospective rebates.
  • No reconciliation. A warehouse without a daily comparison of totals against the ERP loses trust at the first difference.

B2Bnetwork engineers build the data layer and the Power BI model as part of our Data and reporting service: from the metric glossary, through queries in PostgreSQL or Oracle, to data quality checks that stop an error before it reaches the board report.

Questions and answers

How much does a data warehouse cost for a mid-sized company?

The cost depends mainly on the number of sources, the state of the data and the number of metrics in the first stage, and less on the tools: a relational database and one reporting model are a small infrastructure cost. The most expensive part is working out definitions and cleaning up dictionaries. That is why the first stage is best limited to one area and a dozen or so questions.

Is Power BI connected directly to the ERP enough?

To start with, for one source and a few reports, yes. Problems appear when more sources, balance history and shared definitions come in: each report starts calculating its own way and queries load the ERP. At that point a data layer between the ERP and Power BI brings order to the model.

Should the warehouse run on our own server or in the cloud?

Both work at mid-sized company volumes. Your own server fits when you already have infrastructure and people to run it, or requirements about where data lives. A cloud service takes backups and updates off your hands, but needs cost control and a connection to an ERP that sits in your server room.

Who should own the data warehouse?

Technically, the IT team or external engineers who run the loads and tests. Business owners are responsible for metric definitions: finance for receivables and margin, logistics for inventory, sales for customers. Without them, the warehouse becomes one more source of arguments about numbers.

Connecting systems or moving them to the cloud? Talk to an architect.

Let's talk

Read more: Integrations, data and cloud

All in Integrations, data and cloud →