This lesson on First Data Connection is hands-on and example-driven. You will connect Tableau to flat files such as CSVs and Excel workbooks, configure table relations on the canvas, and inspect field metadata. You will also evaluate whether to use a Live connection or an Extract and apply data source filters before beginning sheet-level analysis.
What You'll Be Able To Do
- Initiate a new connection from the Tableau start screen using the text file connector.
- Manage connections by editing file paths or renaming existing data source connections.
- Drag and place individual tables or sheets onto the data source canvas.
- Verify column data types and origin tables within the metadata grid preview.
- Select between Live connections and Data Extracts based on refresh and performance requirements.
- Apply data source filters to exclude irrelevant records before building visualizations.
Detailed Concept Walkthrough
1. Connecting to Flat Files
Tableau ingests structured data by binding specialized connectors to underlying files or servers. Choosing the correct file connector establishes a link to the raw data without altering the source file.
- Mechanism: Launching a new workbook presents the Connect pane where file formats like Text File (.csv, .txt) or Microsoft Excel (.xlsx) are selected to open the file navigator.
- Under the Hood: Tableau creates a workbook-level connection definition referencing the absolute or relative file path on disk without duplicating data until an extract is requested.
- Best Practice: Use the downward arrow on the Connection menu in the Data Source page to edit the file path or rename the connection descriptor when data sources migrate.
# Example Tableau Data Source (.tds) connection configuration XML snippet
<connection class='textscan' directory='/data/flights' filename='wildlife_strikes.csv'>
<relation name='wildlife_strikes.csv' table='[wildlife_strikes#csv]' type='table' />
</connection>
Key Takeaway: Connecting to a file creates a reference pointer in Tableau that leaves the raw source file intact.
2. Canvas Table Placement and Structure
The Data Source canvas defines the data model by pulling individual tables or spreadsheet tabs into Tableau's query pipeline.
- Mechanism: Dragging a table from the left-hand Files list onto the upper canvas registers it as the primary data entity for the workbook.
- Execution Flow: For flat text files, the single file represents one table, whereas multi-tab Excel workbooks expose every worksheet as an independent table in the left pane.
- Nuance: Placing multiple tables on the canvas prepares the data model for combining or blending relationships across sources.
-- Logical representation of a single flat table dropped onto the canvas
SELECT *
FROM [wildlife_strikes#csv]
WHERE 1=1;
Key Takeaway: Single text files yield one table, while Excel files surface distinct sheets that can be individually dragged onto the canvas.
3. Metadata Grid and Field Inspection
The lower metadata pane displays field names, assigned data types, and originating tables for all columns loaded into the canvas.
- Mechanism: The grid shows a sample preview of rows alongside icons indicating assigned types such as text, integer, date, or geographic role.
- Under the Hood: Tableau scans the initial rows of each column to infer schema types automatically, tracking the lineage of every field back to its source table.
- Best Practice: Inspect field data types and origin references in this grid before building views to ensure dimensions and measures parse correctly during blends.
# Conceptual field mapping generated in metadata pane
# [Column Name] | [Inferred Type] | [Origin Source]
# Incident_Date | Date | wildlife_strikes.csv
# Aircraft_Model | String | wildlife_strikes.csv
# Damage_Cost_USD | Integer | wildlife_strikes.csv
Key Takeaway: Verify inferred data types and field origins in the lower preview pane prior to worksheet visualization.
4. Live Connections versus Data Extracts
The connection toggle determines whether Tableau executes real-time queries against the raw source or builds an optimized in-memory snapshot.
- Mechanism: Selecting 'Live' sends direct queries to the source file on every view update, reflecting source modifications immediately upon refresh.
- Under the Hood: Selecting 'Extract' snapshots the data into Tableau's high-performance columnar data engine, reducing query latency across large datasets.
- Best Practice: Use Live connections during active data file editing, but switch to Data Extracts for dashboard responsiveness and production stability.
# CLI command using Tableau Data Extract utility to generate hyper file
tableau-extract create --source wildlife_strikes.csv --output wildlife_strikes.hyper
Key Takeaway: Live connections ensure instant updates from source modifications, while Extracts optimize query speed through columnar storage.
5. Data Source Filtering
Data source filters restrict the rows ingested into the workbook globally before any sheet calculations or aggregations occur.
- Mechanism: Clicking the 'Add' button under Filters in the top right allows defining categorical, range, or conditional exclusion rules.
- Execution Flow: Data source filters are appended to the
WHEREclause of every query sent to the underlying file or extract. - Best Practice: Apply data source filters to permanently eliminate irrelevant historical partitions or invalid records from the entire workbook lifecycle.
-- SQL WHERE clause generated by a Data Source Filter
SELECT [Incident_Date], [Aircraft_Model], [Damage_Cost_USD]
FROM [wildlife_strikes#csv]
WHERE [Incident_Year] >= 2015;
Key Takeaway: Data source filters permanently exclude unwanted records at the ingestion stage across all workbook sheets.
Topics Covered in First Data Connection
- Opening Workbook and File Selection (0:00 - 0:20) — The instructor opens a new Tableau workbook and selects the Text File connection option.
- Connection Options and Table Management (0:21 - 0:45) — The instructor explains how to edit connection paths and contrasts text file tables with multi-tab Excel files.
- Canvas Placement and Metadata Grid (0:46 - 1:05) — The dataset is dragged onto the canvas, revealing field names, data types, and originating tables in the lower grid.
- Live vs Extract and Global Filtering (1:06 - 1:30) — The instructor contrasts Live connections with Data Extracts and explains how to add data source filters.
- Navigating to Sheet 1 (1:31 - 1:45) — The instructor clicks the orange Sheet 1 tab to leave data configuration and enter the visual workspace.
Reference Cheat Sheet
-
Connect > Text file— Opens file dialog to import CSV or delimited text filesConnect -> Text file -> wildlife_strikes.csv -
Connection > Edit Connection— Updates file path or reconnects to a renamed sourceData Source Tab -> Connections -> Edit Connection... -
Canvas Drag-and-Drop— Adds a file or worksheet to active data modelDrag [wildlife_strikes.csv] to 'Drag tables here' canvas -
Connection: Live— Directly queries raw file; updates reflect instantly on refreshRadio selection: (o) Live -
Connection: Extract— Saves snapshot into columnar format for faster processingRadio selection: (o) Extract -
Filters > Add— Applies global row-level filter across the entire workbookFilters -> Add -> [Damage_Cost_USD] > 0 -
Sheet 1 (Navigation)— Exits Data Source screen to begin building visual worksheetsClick orange tab: Sheet 1
Comparison Table
| Feature / Dimension | Live Connection | Data Extract |
|---|---|---|
| Query Target | Direct file on disk | In-memory snapshot (.hyper) |
| Source Updates | Reflected immediately on refresh | Requires extract refresh job |
| Query Speed | Dependent on source I/O | Optimized for fast rendering |
| Offline Availability | Requires source file access | Self-contained inside extract |
Common Pitfalls
- Mistake: Expecting multiple tables inside a plain CSV connector. Avoid: Remember text files contain only one table whereas Excel files contain multiple tabs.
- Mistake: Leaving unwanted records in large files. Avoid: Apply Data Source Filters in the top right before building sheets.
- Mistake: Assuming Live connections automatically cache data. Avoid: Switch connection type to Extract when query latency on disk files becomes slow.
FAQs
- Why does a text file connection only show one table in the Files pane? A CSV or delimited text file represents a single flat dataset, unlike an Excel workbook which can hold multiple distinct worksheets.
- When should I choose a Live connection over an Extract? Choose Live when underlying source data changes frequently and updates must appear immediately without triggering an extract refresh.
- What happens when I apply a filter on the Data Source page? It applies globally to the connection, removing those records from all calculations, worksheets, and dashboard views.