Skip to content

Clean and combine two files before analyzing them

Your customers are in one tool, your orders in another. The two exports share a customer identifier, but neither is enough on its own: the CRM knows the segment and the region, the ERP knows the amounts. This tutorial combines them without touching the files.

A data app with two charts built by you: revenue per customer segment and number of orders with no known customer in the CRM, computed by two Prepare transformations you can edit.

Duration: 20 minutes.

  • A Matr account.

  • The two sample files:

    • crm-customers.csv: 240 customers, with customer_id, company, segment (SMB, Mid-market, Enterprise), region, account_manager, customer_since;
    • erp-orders.csv: 3,200 orders, with order_id, customer_id, order_date, product, quantity, amount.

    Both share customer_id. 204 orders carry an identifier missing from the CRM: this is on purpose, you are going to find them.

It is the same flow as in From my files to my first dashboard, with two files instead of one.

  1. On the Home page, drag crm-customers.csv and erp-orders.csv together into the drop area, then Start the analysis.

  2. During the analysis, the links between files counter goes to 1: the log says that the two files share customer_id (93.6% of orders find their customer). This link is what will make the join possible in Prepare.

    Close-up of the log: "erp-orders.csv and crm-customers.csv share customer_id (93.6%)"

  3. Under What are you interested in?, type “Revenue per customer segment and per region”, select the Recommended by Matr card, then Create the DataApp and Go to the DataApp.

Expected result: a data app with two linked datasets (the crm-customers and erp-orders chips in the header) and a first dashboard. You are now going to build your own charts, step by step, to understand the combination.

2. Bring the customer segment onto each order

Section titled “2. Bring the customer segment onto each order”
  1. Open the Prepare tab.

  2. In the Data panel on the left, click the orders dataset (erp-orders). A check mark shows the dataset being displayed.

    Close-up of the Data panel: crm-customers and erp-orders with their sizes, then Transformations

    The grid shows the 3,200 orders. Prepare opens in read mode: the toolbar only offers Edit, Manage data, Pivot table, Density and Full screen.

    Prepare in read mode on erp-orders: Data panel, Draft, the grid and the banner 200 rows shown out of 3,200

  3. Click Edit. The toolbar changes: Done, Filter, Compute, Join, Group, Deduplicate, Columns, Format, and on the right Use. The Draft rail appears on the left, with no step yet.

    Prepare in Edit mode: the full toolbar and the Draft rail with no step

    Close-up of the Edit mode toolbar

  4. Click Join. Under Linked tables, the customers dataset is offered with the key customer_id = customer_id already filled in and the note “94% of rows find a match”.

  5. Check the columns to bring: segment, region and account_manager. The Prefix for brought columns is required and pre-filled with crm_customers_: replace it with crm_ for short names.

    Bring columns window: the linked table crm-customers, 94% match, the checked columns and the prefix

  6. Click Bring columns.

Expected result: three columns are added to the right of the grid: crm_segment, crm_region, crm_account_manager. For 204 orders, they are empty: these are the orders whose customer is not in the CRM. The step rail, on the left, shows the step “Columns from crm_customers”.

The grid after the join, with the three brought columns, and the step in the rail

Close-up of the rail: step 0 erp-orders, step 1 Columns from crm_customers, Add a step

  1. Click Group.

  2. Group by: check segment in the CRM-CUSTOMERS block (it is the brought column, crm_segment).

  3. Calculations: Column amount, Calculation Sum, Result name revenue.

    Group and compute window: segment checked, the Sum of amount calculation named revenue

  4. Confirm with Group.

Expected result: the grid now shows only four rows: SMB, Mid-market, Enterprise, and an empty row for the orders with no customer. Each with its revenue.

The result of the grouping: four rows, crm_segment and revenue, the rail shows two steps

4. Save the transformation and create the chart

Section titled “4. Save the transformation and create the chart”
  1. At the bottom of the rail, click Save. Replace the suggested name (“Transformation of erp-orders”) with “Revenue per segment”, then Save.

    Save transformation window with the Name field

  2. Click Use, then Create widget.

    The Use menu: Create widget, Save as dataset

    Close-up of the Use menu

  3. Widget title: “Revenue per customer segment”. Widget type: Bars. Horizontal axis: crm_segment. Value: revenue. If the dashboard has several tabs, also pick the Dashboard tab. Confirm with Create widget.

    Create widget window: title, Bars type, crm_segment axis, revenue value

Expected result: the message “Widget added to the dashboard” shows and the widget appears in Report. It replays the transformation every time it is displayed: if you change a step, the chart follows.

5. Isolate the orders with no known customer

Section titled “5. Isolate the orders with no known customer”

Start again from the orders dataset for a second transformation.

  1. In Data, click erp-orders again. The previous draft is saved: you start fresh.

  2. Edit, then Join: bring segment as in step 2, with the crm_ prefix.

  3. Click Filter. Column crm_segment, Condition Is empty. Confirm with Filter.

    Filter rows window: Column crm_segment, Condition Is empty, Add a condition

  4. The rail says how many rows were removed: 204 remain.

  5. Save under the name “Orders with no CRM customer”.

  6. Use → Create widget: Title “Orders with no customer in the CRM”, Type KPI, KPI value From a column, Aggregation Row count (no column to pick: every remaining row counts). Confirm.

Expected result: a KPI at 204 in Report. When the CRM is updated and the files refreshed, this number will go down on its own.

Open the Report tab. Your two widgets are there, after the ones Matr had built.

The Report tab of the data app, with the KPIs, the chart of the segment-region combinations and the AI Insight

Your two widgets are there. In Prepare, the Transformations panel lists “Revenue per segment” and “Orders with no CRM customer”, each with the number of widgets that use it: this is why they can no longer be deleted without removing the widgets first.

What you seeWhat to do
Join offers no tableThe link between the two datasets was not detected. Open the detail page of the orders dataset (Data > Datasets), Keys & relations tab, and declare the link on customer_id. See Data and datasets.
Several rows may matchYour customers table has duplicates on the key. Add a Deduplicate step on a transformation of the customers, or clean the source file.
The banner under the grid says Computed on the first N rowsThe preview works on a sample; the widgets compute on everything.
The total per segment does not match your spreadsheetCheck the type of amount in the column detail: an amount read as text does not add up.