Tableau
Intermediate 13 min read Tableau

Tableau Workbooks, Data Sources and Prep

The container, the connections and the cleaning layer

A workbook ties together sheets, dashboards, stories and one or more data sources; data sources hold connections, relationships, joins and filters. Prep flows clean and restructure data upstream.

workbookdata sourcePreprelationshipsjoinsextract
Prerequisites: Tableau Overview
Before we start

What you will learn

  • Structure a workbook's sheets, dashboards and stories coherently
  • Model a data source with relationships vs joins
  • Use Tableau Prep for reshaping upstream
Introduction

What is this?

The Tableau workbook (.twb / .twbx) contains data source definitions plus sheets, dashboards and stories. Each data source wraps a connection (live or Extract), defines table relationships or joins, applies filters and calculated fields at the source level. Tableau Prep is the separate cleaning layer for bigger transformations you don't want in the viz.

Motivation

Why do you need it?

  • A tidy workbook makes the next analyst — or the next dashboard — instantly legible.
  • Data-source-level fields propagate to every dependent sheet (DRY for analytics).
  • Relationships (à la tableau 2020.2+) replace fragile join directionality.
  • Prep pushes heavy cleaning out of the viz and keeps extracts lean.
Think about it

Mental model

Imagine

A binder of recipes plus the grocery list

Think of

Workbook + data source

The binder (workbook) holds each recipe (sheet) and the meal plan (dashboard). The grocery list (data source) is shared—every recipe reads from the same list, so you fix the list once and every dish improves. Prep is the produce-washer before anything hits the basket.

Mechanics

How it works

  • Workbook: sheets/tiles + dashboards/tiles + stories; all read from shared data sources.
  • Data source: connection details, relationships between logical tables, optional extract refresh settings.
  • Relationships create flexible many-to-many-ish joins resolved per-field; no need to pre-pick the join.
  • Extract = a local snapshot accelerating interactivity; filters at the source prune rows.
  • Prep flows chain clean steps (group, pivot, clean, aggregate) and publish or write to the data source.

Prep → data source → workbook sheets → dashboard.

Raw data
Prep flow
Data source
Sheets
Dashboard
Hands-on

Examples

Relationship-first data source

Relationship-first data source
Logical layer:
fact_orders (order_id, cust_id, amount)
dim_customer (cust_id, name, region)
dim_date (date, fiscal_quarter)
Relationship: fact_orders[cust_id] ↔ dim_customer[cust_id] (1:1/many)
fact_orders[date] ↔ dim_date[date]
Benefits: no pre-chosen join direction;
filtering by region automatically flows to orders.

Relationships describe how tables relate; Tableau decides the join per query. No duplicated rows, no ambiguity about which table has the leading keys.

Real world

In production

  • A sales workbook shares one data source: sheets filter region/profit and dashboards inherit the same refresh.
  • An extract is refreshed nightly so interactive dashboards stay snappy during the day.
  • A Prep flow pivots long-format rows into columns before they ever reach the viz.
Guidelines

Best practices

  • Define reusable calculations and groups at the data-source level, not per sheet.
  • Use relationships over joins; reserve joins for cases relationships can't express.
  • Package extracts (.twbx) when sharing offline; keep .twb (live) for server publishing.
  • Name Prep steps; document what each cleans so the flow is auditable.
Watch out

Common mistakes

  • Putting the same calculation in 15 sheets instead of the data source.
  • Traditional joins for everything, producing fan-out duplicates.
  • Live connection to a big source without extract/aggregation, tanking the sheet's responsiveness.
  • Editing data in Prep but never re-publishing, so the dashboard reads stale rows.
When things break

Debugging tips

  • Rows doubled → a many-to-many join path; switch to relationships or check join keys.
  • Field missing → confirm the sheet uses the data source that defines it.
  • Extract stale → the refresh schedule isn't hitting the source; check publish/refresh state.
Interviews

Interview checkpoint

Practice

Hands-on lab

Model Workbooks, Sources and Prep in SQL
45 min · intermediate
In progress
Objectives
  • Simulate a relationship-based model in SQL
  • Compare relationship results vs a naive JOIN fan-out
  • Draft a Prep flow as SQL steps upstream

Model Workbooks, Sources and Prep in SQL

45 min · intermediate

0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

What is the recommended modern way to model multiple tables in Tableau?

2

A data-source-level calculated field is available to every dependent sheet.

Go deeper

Official documentation