At a glance
- Challenge: customer, order and invoice data live in separate CRM, ERP and accounting systems. Every team reports a different revenue number, and nobody can say which one is right.
- Solution: one visual DataFloem job reads all three systems, aligns their keys, currencies and periods, and writes one revenue table to Apache Iceberg.
- Value: one table that every report starts from: revenue by month, revenue that was never invoiced, and an outlook that reads the lakehouse and the CRM in one query.
The scenario
Synthetic data. The company, customers and figures are made up. Exchange rates are fixed demo rates, not market data.
It is the start of the quarterly review, and the CFO asks one simple question: what was our Q3 revenue?
- Sales opens the CRM and says €6.85M, the deals closed as won.
- Operations opens the ERP and says €6.41M, the orders booked.
- Finance opens the accounting system and says €6.26M, the invoices issued.
All three are right about their own system. None of them can answer the question.
One order shows why. Maple Foods Inc is customer
C-00012 in the CRM and customer 12 in the
ERP. On July 2 it placed order 501593 for €17,299. The order is in the
ERP, but there is no invoice for it in accounting. Across the year,
105 orders like this one, worth almost €1M, were never billed.
Why the numbers disagree
Organizations often keep sales, financial and customer information in separate CRM, ERP and accounting platforms. That makes it hard to build consistent revenue reports, analyze sales performance and forecast results. In practice, three things go wrong:
-
Different keys. The same customer has a
different identifier in every system (
C-00012and12). - Different currencies. ERP orders are recorded in EUR, USD and TRY. The CRM keeps deal values in EUR.
- Different moments. The CRM counts a deal when it is won, the ERP counts an order when it is booked, and accounting counts an invoice when it is issued. An order that was never invoiced does not appear in accounting at all.
The data sources
| System | Where it lives in the demo | What it contributes |
|---|---|---|
| CRM |
PostgreSQL (crm.crm_customers,
crm.crm_opportunities)
|
120 customers with segment and region; won deals and 60 open opportunities |
| ERP | Oracle (DFL_ERP_SALES_ORDERS) |
2,351 sales orders over 12 months, in EUR, USD and TRY |
| Accounting | CSV export in object storage (MinIO) | 2,246 invoices with invoice number and payment status |
DataFloem reads the CRM and ERP through their databases and accounting through a file export. The demo does not use a vendor-specific CRM or ERP connector.
Building the job in DataFloem
One job does all the work: Unified Revenue to Iceberg. Its flow has nine nodes:
CRM customers (PostgreSQL) ─▶ Expression: customer_key ─┐
ERP orders (Oracle) ────────────────────────────────────┴─▶ Join ─┐
Invoices CSV (object storage) ────────────────────────────────────┴─▶ Join ─▶ Expression ─▶ Select ─▶ Iceberg: revenue_fact
-
Start from what is already connected. The project
in the
productionnamespace already has three sources assigned: the PostgreSQL connection for the CRM, the Oracle connection for the ERP and the object storage connection for accounting. An Apache Iceberg catalog is assigned too. Before building anything, a SQL query shows that the target table,revenue_fact, is empty: 0 rows. -
Fix the customer key. The CRM writes a customer as
C-00012, the ERP as12. An Expression node adds acustomer_keycolumn that removes the prefix and the leading zeros and turns the rest into a number:cast(regexp_replace(customer_id, '^C-0*', '') as int). Now both systems speak the same language. -
Join orders, customers and invoices. The first
Join matches every ERP order to its CRM customer on
CUSTOMER_NO = customer_key. The second brings in the invoices on the order ID. Both are left outer joins. This matters most in the second one: an order without an invoice stays in the result instead of disappearing. Those empty invoice fields are the revenue nobody billed. -
One currency, one period, one billing status. A
second Expression node adds three columns:
amount_eur, the order amount converted with fixed demo rates (EUR 1, USD 0.92, TRY 0.027);period, the order's year and month asyyyy-MM; andbilling_status,NOT_INVOICEDwhen the order has no invoice andINVOICEDotherwise. - Keep what analysts need. A Select node keeps the columns analysts use, keeps the three new ones and gives every column the same naming style. Fourteen columns remain: the order, its customer, its money and its billing story, in one row.
-
Test, then write to Iceberg. The last node writes
to
revenue_factin the Iceberg catalog with the Overwrite strategy, so running the job again replaces the table instead of doubling every row. Before anything is written, a Partial Run executes every node except the target on the Spark cluster, and Data Preview shows every order with its customer, its invoice, an amount in euros, a period and a billing status. Then the whole job runs, and its run log confirms that every step succeeded.
The verified result
Back in SQL Queries, the table is checked against the source data:
| Check | Result |
|---|---|
Orders in revenue_fact |
2,351, every ERP order |
| Booked revenue | €26,538,790.00 |
| Orders never invoiced | 105 |
The figures match the expected values of the synthetic data set exactly.
Three questions, one table
1. Revenue by month. One query, twelve months. Q3 2026 (July to September) comes to €6.41M booked: €6.18M invoiced and €233K not invoiced.
SELECT period, CAST(ROUND(SUM(amount_eur)) AS BIGINT) AS booked_eur
FROM retail_lakehouse.revenue.revenue_fact
GROUP BY period ORDER BY period;
2. Which orders were never invoiced?
SELECT region, COUNT(*) AS orders,
CAST(ROUND(SUM(amount_eur)) AS BIGINT) AS not_invoiced_eur
FROM retail_lakehouse.revenue.revenue_fact
WHERE billing_status = 'NOT_INVOICED'
GROUP BY region ORDER BY not_invoiced_eur DESC;
| Region | Orders | Not invoiced (EUR) |
|---|---|---|
| EMEA | 45 | 480,159 |
| North America | 29 | 234,816 |
| Turkey | 22 | 224,344 |
| APAC | 9 | 58,545 |
3. What comes next? One query reads the Iceberg table and the CRM's open opportunities together, through the same catalog. It shows the recent monthly average, €2,212,778.67 (August to October), next to 60 open deals with a weighted pipeline of €769,297.90 (deal value × probability).
WITH run AS (
SELECT CAST(ROUND(SUM(amount_eur) / 3, 2) AS DECIMAL(14,2)) AS monthly_run_rate_eur
FROM retail_lakehouse.revenue.revenue_fact
WHERE period IN ('2026-08', '2026-09', '2026-10')
), pipe AS (
SELECT COUNT(*) AS open_deals,
CAST(ROUND(SUM(amount_eur * probability), 2) AS DECIMAL(14,2)) AS weighted_pipeline_eur
FROM retail_lakehouse.crm.crm_opportunities
WHERE stage <> 'CLOSED_WON'
)
SELECT * FROM run CROSS JOIN pipe;
This is an outlook, not a forecast. It puts two facts side by side and leaves the decision to people.
Architecture
PostgreSQL (CRM customers) ──┐
Oracle (ERP sales orders) ───┼─▶ DataFloem visual job ─────────────────▶ Apache Iceberg: revenue_fact
MinIO (invoices CSV) ────────┘ key fix · joins · currency · period · │
billing status · select │
on a Spark cluster (Kubernetes) ▼
PostgreSQL (CRM opportunities) ── catalog (JDBC namespace) ──────────▶ SQL Queries: one query
over lakehouse + CRM
What this demo does not claim
- No vendor-specific CRM or ERP connector. The data is read from databases and a file export.
- No real-time synchronization or change data capture. The job runs as a batch.
- No machine-learning forecast. The outlook compares a run rate with a weighted pipeline.
- No market exchange rates. The conversion uses fixed demo rates.
- All data is synthetic.
What it means for the business
| Before | With DataFloem |
|---|---|
| Three systems, three revenue numbers | One revenue table that every report starts from |
| Customer keys matched by hand | One expression that aligns them, every run |
| Mixed currencies in one column | Every amount also in euros |
| Unbilled orders invisible to finance | Every order kept, with a billing status |
| Pipeline and revenue in different tools | One SQL query across the lakehouse and the CRM |
The DataFloem capabilities it uses
| Capability | Role in this use case |
|---|---|
| Data integration | PostgreSQL, Oracle and object storage sources in one job |
| Data processing | Expression, Join, Select and catalog target nodes on a visual canvas |
| Partial Run and Data Preview | Testing the flow before anything is written |
| Apache Iceberg catalog | The unified revenue_fact table |
| Hybrid catalog | Querying the CRM's tables next to Iceberg tables |
| SQL Queries | Verification and business questions on the same platform |
See it in action
The video below follows the same job on the DataFloem canvas, from the
empty revenue_fact table to the three questions answered
with SQL.