# Design your datasets

Decide what becomes a dataset, which fields it needs and how your datasets link, all before you build anything.

Source: https://support.rework.com/article/design-your-datasets

Ten minutes of design saves weeks of cleanup. Most messy datasets share the same few mistakes: one giant table that should have been three, a name typed in every row instead of a link, a number stored as text that nobody can sum. The good news is they're easy to avoid. This article walks you through the questions to answer on paper first, using Northwind Studios' client work as the example.

## Step 1: Find the things, not the reports

Start from the nouns your team talks about, not from the report you want at the end. Each distinct _thing_ that has its own attributes becomes a dataset.

| Your team says… | The thing | Dataset |
| --- | --- | --- |
| "Acme is based in Austin" | a client | **Clients** |
| "The launch film is due October 15" | a project | **Projects** |
| "The 60-second cut is in review" | a deliverable | **Deliverables** |

Here's a good test: if you'd type the same value in many rows (the client's city on every project), that value belongs to another thing, and that thing deserves its own dataset.

> **Tip:** Reports come later, and for free. "Fees booked per client" isn't a dataset: it's a rollup on **Clients** or a chart in an app. 💡

## Step 2: One row, one thing

Each record should describe exactly one instance of its thing. Watch out for rows that hide several:

| Avoid | Why it hurts | Instead |
| --- | --- | --- |
| A project row with _Deliverable 1_, _Deliverable 2_, _Deliverable 3_ columns | The fourth deliverable has nowhere to go, and you can't filter by deliverable | A **Deliverables** dataset linked to **Projects** |
| A client row per year | The same client exists five times | One client row, with dated projects linked to it |
| A _Notes_ column holding status, owner and due date | Nothing can be filtered or sorted | Separate **Status**, **Assigned to** and **Due on** fields |

## Step 3: Pick the field type for how the value is used

The type is a promise about the value. Choose it for what people will do with the value, not for how it looks today.

| If people will… | Use | Not |
| --- | --- | --- |
| Sum, average or chart it | **Currency**, **Integer** or **Decimal** | Text |
| Filter or group by a fixed list | **Dropdown** or **Multi-Select** | Text |
| Sort by time or ask "what is due" | **Date** or **Date & Time** | Text |
| Point at a person in the workspace | **User** or **Users** | Text |
| Point at a record in another dataset | **Two-way link dataset record** | Text or Dropdown |
| Attach a brief or a contract | **File** or **Files** | URL to a drive |

See [Field types](https://support.rework.com/article/field-types) for the full list.

## Step 4: Draw the links

Once you have your datasets, draw an arrow for every "belongs to":

`Deliverables ──belongs to──▶ Projects ──belongs to──▶ Clients`

Each arrow is a **link** field on the dataset the arrow starts from: **Project** on Deliverables, **Client** on Projects. The reverse side (a client's list of projects) is created for you.

Then decide what should flow back along the arrows:

| On | Field | Kind | Reads |
| --- | --- | --- | --- |
| Projects | Client city | Lookup | City of the linked client |
| Clients | Hours booked | Rollup, Sum | Estimated hours of linked projects |
| Clients | Fees booked | Rollup, Sum | Fee of linked projects |

A rollup aggregates a **number** field of the linked records: Integer, Decimal, Currency, Rating, Progress or Formula. If you'll want totals per client, make sure the linked dataset stores that value in a number field, not as text.

See [Link, lookup and rollup fields](https://support.rework.com/article/link-lookup-and-rollup-fields).

## Step 5: Decide where fields live

Every new field is either **Internal** (only this dataset), **Service** (shared by datasets of the same model) or **Global** (available everywhere in the workspace).

- Default to **Internal**. It keeps the workspace catalog short.
  
- Use **Global** only for information that genuinely means the same thing everywhere, such as _Department_ or _Cost center_, and create it once.
  
- Before creating a field, check **Pick existing field…**: if _Department_ already exists, attach it instead of making a second one.
  

## Step 6: Plan who sees what

Write down, per dataset, who should be able to open it and who should be able to add records. Client fees might be visible to sales and finance only, while deliverables are open to the whole studio. Access is set on each dataset; see [Share a dataset](https://support.rework.com/article/share-a-dataset).

## Checklist before you build

- Each dataset is one kind of thing, named in plural.
  
- No value is typed repeatedly that belongs to another dataset.
  
- Every number you want to add up is a number field.
  
- Every fixed list is a dropdown with agreed options.
  
- Every "belongs to" is a link, drawn in one direction.
  
- Lookups and rollups replace every manually copied value.
  
- Access is decided per dataset.
  

All ticked? You're ready to [create your first dataset](https://support.rework.com/article/create-your-first-dataset), or [start from a template](https://support.rework.com/article/dataset-start-from-a-template) that already follows this shape.
