CSV Import

This article explains how to import data from CSV files into Model Reef and how to structure CSVs so that they map cleanly to variables and drivers.

You will learn:

  • When to use CSV import.

  • How to structure CSV files.

  • How to map rows and columns to series.

  • How CSV import fits alongside PDF and Excel import.


When to use CSV import

CSV import works well when:

  • You have simple, tabular data from systems that export CSV only.

  • You are pulling data from scripts, code, APIs or data warehouses.

  • You can control the column names and layout precisely.

  • You want a lightweight, reproducible import format.

If your data is already in well structured Excel sheets, Excel import can be more convenient. CSV is ideal for automated or scripted data pipelines.


Structuring CSV files

CSV files used for import should generally have:

  • A single header row.

  • One date or period column.

  • One value column per series, or one row per series depending on the chosen layout.

  • No merged cells or embedded formatting.

Two common patterns are:

Pattern 1: One series per column

Columns:

  • Period, Series A, Series B, Series C

Each row represents one period. Each value column represents a different metric or series.

Pattern 2: One series per row (long format)

Columns:

  • SeriesName, Period, Value

Each row represents a single data point for one series at one period. This format is often easier to generate from databases.

Model Reef can work with both, but long format is generally more flexible for programmatic workflows.


1

Uploading CSV files

In the import interface:

  • Choose Import from CSV.

  • Upload one or more CSV files.

  • For each file, select the sheet or parsing options if prompted (for example delimiter, encoding).

You will then see a preview of the parsed table.

2

Identifying date and value fields

For each CSV table you should:

  • Mark which column is the date or period column.

  • Confirm the format of the dates (for example YYYY-MM-DD, YYYY-MM, YYYY).

  • Mark which columns contain values to import.

If using long format, you will also indicate which column holds the series names or IDs.

3

Mapping to variables and drivers

Once dates and value fields are identified, you map each value series to:

  • A variable type (if it is a direct model variable).

  • Or a driver or Data Library entry (if it is an input series only).

  • A category and subcategory if relevant.

  • A branch if the data relates to a specific part of the business.

  • Appropriate units and frequency.

You can import:

  • Operational drivers such as volumes, prices or conversion rates.

  • Financial series such as revenue, COGS or expenses.

  • External indices used in formulas or scenarios.

4

Updating CSV based data

For recurring CSV imports from the same source, aim to:

  • Keep file and column layouts stable.

  • Use naming conventions for series that match your model.

  • Use the same mapping each time so that updates are seamless.

Over time, you can replace manual CSV uploads with more automated solutions if you wire an API or data pipeline into a scheduled CSV export and import process.


Practical tips

  • Validate CSV files before import to catch encoding or delimiter issues early.

  • Keep separate CSVs per domain (for example financials vs operational metrics) if that makes mapping clearer.

  • Document the CSV structure in your team so that future exports follow the same pattern.


Last updated