Lý thuyết
45 phút
Bài 2/4

Tableau Fundamentals

Làm quen Tableau Desktop - Interface, data connection, và tạo visualizations cơ bản

Tableau Fundamentals

Tableau là tool visualization mạnh nhất thế giới, được dùng bởi Fortune 500 companies. Bài này sẽ guide bạn từ cài đặt đến tạo visualization đầu tiên.

🎯 Mục tiêu

  • Cài đặt và setup Tableau
  • Hiểu Tableau interface
  • Connect và prepare data
  • Tạo các charts cơ bản
  • Build dashboard đầu tiên

1. Tableau Products Overview

1.1. Tableau Family

ProductPurposeCost
Tableau DesktopCreate visualizations$70/mo
Tableau PublicFree version (public data only)Free
Tableau ServerShare internallyEnterprise
Tableau OnlineCloud sharing$42/user/mo
Tableau PrepData preparationIncluded

1.2. Installation

For learning: Tableau Public (Free)

  1. Download từ public.tableau.com
  2. Install và create account
  3. Limitation: Saves to public cloud only

For work: Tableau Desktop

  1. Download trial từ tableau.com
  2. 14-day free trial
  3. Full features

2. Tableau Interface

2.1. Start Page

Text
1┌─────────────────────────────────────────────────────────────┐
2│ CONNECT │ OPEN │
3│ ───────────────── │ ───────────────── │
4│ To a File │ Recent Workbooks │
5│ • Excel │ • Sales_Dashboard.twb │
6│ • Text file │ • Marketing_Report.twb │
7│ • JSON │ │
8│ • More... │ Sample Workbooks │
9│ │ • Superstore │
10│ To a Server │ • World Indicators │
11│ • Tableau Server │ │
12│ • MySQL │ DISCOVER │
13│ • PostgreSQL │ ───────────────── │
14│ • More... │ Viz of the Day │
15└─────────────────────────────────────────────────────────────┘

2.2. Workspace

Text
1┌─────────────────────────────────────────────────────────────────────────┐
2│ File Data Worksheet Dashboard Story Analysis Map Format Server │
3├───────────────┬─────────────────────────────────────────────────────────┤
4│ DATA │ │
5│ ┌───────────┐ │ │
6│ │ Tables │ │ │
7│ │ └Orders │ │ CANVAS (Drop fields here) │
8│ │ └Customers│ │ │
9│ │ └Products │ │ │
10│ └───────────┘ │ │
11│ │ │
12│ DIMENSIONS │ │
13│ ┌───────────┐ │ ┌─────────────────────────────────────────────────┐ │
14│ │ Category │ │ │ │ │
15│ │ Region │ │ │ Your visualization │ │
16│ │ Segment │ │ │ appears here │ │
17│ │ Ship Mode │ │ │ │ │
18│ └───────────┘ │ └─────────────────────────────────────────────────┘ │
19│ │ │
20│ MEASURES │ │
21│ ┌───────────┐ │ │
22│ │ Sales │ │ │
23│ │ Profit │ │ ┌──────────────────────────────────────────┐ │
24│ │ Quantity │ │ │ Columns: │ │
25│ │ Discount │ │ │ Rows: │ │
26│ └───────────┘ │ └──────────────────────────────────────────┘ │
27├───────────────┴─────────────────────────────────────────────────────────┤
28│ [Sheet 1] [Sheet 2] [+] │ [Dashboard 1] [Story 1] │
29└─────────────────────────────────────────────────────────────────────────┘

2.3. Key Terms

TermDefinition
DimensionCategorical data (Region, Category, Date)
MeasureNumeric data (Sales, Profit, Quantity)
Rows/ColumnsShelves định vị data
MarksVisual elements (bars, lines, points)
FiltersLimit data displayed
PagesAnimation/stepping through data

3. Connecting to Data

3.1. Data Source Page

Text
1┌─────────────────────────────────────────────────────────────┐
2│ Connections │ Sheets │
3│ ──────────────── │ ───────────────── │
4│ ● Sample-Superstore │ □ Orders 1000 rows │
5│ (Excel) │ □ People 4 rows │
6│ │ □ Returns 296 rows │
7├───────────────────────┴────────────────────────────────────┤
8│ │
9│ Drag tables here to relate them │
10│ │
11│ ┌─────────┐ │
12│ │ Orders │ │
13│ └─────────┘ │
14│ │
15├─────────────────────────────────────────────────────────────┤
16│ Preview: (first 1000 rows) │
17│ ─────────────────────────────────────── │
18│ Row ID | Order ID | Order Date | Ship Date | ... │
19│ 1 | CA-2021 | 2021-01-03 | 2021-01-07 | ... │
20│ 2 | CA-2021 | 2021-01-04 | 2021-01-08 | ... │
21└─────────────────────────────────────────────────────────────┘

3.2. Supported Data Sources

Files:

  • Excel (.xlsx, .xls)
  • Text files (.csv, .txt)
  • JSON
  • PDF (tables)

Databases:

  • MySQL, PostgreSQL, SQL Server
  • Google BigQuery
  • Snowflake
  • Amazon Redshift

Cloud Apps:

  • Google Sheets
  • Salesforce
  • Google Analytics

3.3. Data Prep Basics

Text
1Right-click field → Options:
2├── Rename
3├── Change data type (String, Number, Date)
4├── Create calculated field
5├── Create group
6├── Create hierarchy
7├── Hide
8└── Split (for text fields)

4. Building Basic Charts

4.1. Bar Chart - Category Sales

Steps:

  1. Drag Category to Columns
  2. Drag Sales to Rows
  3. Done!
Text
1Sales by Category
2
3$800K ┤ ████████
4$600K ┤ ████████
5$400K ┤ ████ ████████ ████
6$200K ┤ ████ ████████ ████
7 0 ┼────────────────────────
8 Furniture Office Technology
9 Supplies

Enhancements:

  • Sort: Click sort icon in toolbar
  • Color: Drag Category to Color
  • Labels: Click Label in Marks card

4.2. Line Chart - Sales Trend

Steps:

  1. Drag Order Date to Columns (auto-becomes YEAR)
  2. Click + on date to expand to Quarter or Month
  3. Drag Sales to Rows
Text
1Sales Over Time
2
3$100K ┤ ╱╲
4 $80K ┤ ╱╲ ╱ ╲
5 $60K ┤ ╱╲ ╱ ╲ ╱
6 $40K ┤ ╱╲ ╱ ╲ ╱
7 $20K ┤__╱ ╲╱
8 0 ┼────────────────────────
9 Q1 Q2 Q3 Q4 Q1 Q2 Q3
10 2022 2023

4.3. Scatter Plot - Profit vs Sales

Steps:

  1. Drag Sales to Columns
  2. Drag Profit to Rows
  3. Drag Category to Color
Text
1Profit │ ●
2 │ ● ●
3 0 ┼─────────●────────────
4 │ ● ●
5 │ ●
6 └─────────────────────────
7 Sales
8
9● Furniture ● Office ● Technology

4.4. Map - Sales by State

Steps:

  1. Double-click State (auto-generates map)
  2. Drag Sales to Color
Text
1┌────────────────────────────────────┐
2│ ▪ ▪ ░░░ ▓▓▓ │
3│ ▪ ░░░░░░░ ▓▓▓ ▓▓ │
4│ ▪▪▪ ░░░░░░░░░░▓▓▓▓▓▓ │
5│ ░░░░░░░░░░░░░░░ ▓▓▓ │
6│ ░░░░░░░░░░░░░░░ ░ │
7│ │
8│ Legend: ▪ Low ░ Medium ▓ High │
9└────────────────────────────────────┘

5. Formatting & Polish

5.1. Marks Card

Text
1┌────────────────┐
2│ Marks │
3│ ──────────────│
4│ [Automatic ▼] │ ← Chart type
5│ ● Color │ ← Color encoding
6│ ○ Size │ ← Size encoding
7│ Abc Label │ ← Data labels
8│ ◐ Detail │ ← Add detail
9│ △ Tooltip │ ← Hover info
10└────────────────┘

5.2. Color Customization

  1. Click Color in Marks
  2. Edit Colors
  3. Choose palette (Sequential, Diverging, etc.)
  4. Adjust stepped colors

5.3. Tooltips

Default tooltip:

Text
1Category: Technology
2Sales: $836,154

Custom tooltip:

Text
1📱 {Category}
2💰 Revenue: ${Sales}
3📈 Growth: {Profit Ratio}%
4Click to see details →

Edit: Worksheet → Tooltip

5.4. Reference Lines

Add context:

  • Average line
  • Target line
  • Trend line
  • Bands (confidence intervals)
Text
1Analytics Pane → Drag Reference Line to chart

6. Filters

6.1. Filter Types

TypeHow to AddUse
Dimension FilterDrag to FiltersInclude/exclude categories
Measure FilterDrag to FiltersRange of values
Date FilterDrag to FiltersDate range
Context FilterRight-click → Add to ContextFilter that applies first

6.2. Show Filter Control

Text
1Right-click filter → Show Filter
2
3┌─────────────────┐
4│ Category │
5│ ☑ Furniture │
6│ ☑ Office Suppl │
7│ ☐ Technology │ ← User can toggle
8└─────────────────┘

6.3. Filter Actions

Interactivity:

  • Click bar → Filter other sheets
  • Select region on map → Update charts

7. Calculated Fields

7.1. Creating Calculations

Text
1Right-click in Data pane → Create Calculated Field
2
3Name: Profit Ratio
4Formula: [Profit] / [Sales]

7.2. Common Calculations

SQL
1-- Profit Margin
2[Profit] / [Sales]
3
4-- Year-over-Year Growth
5(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1)
6
7-- Running Total
8RUNNING_SUM(SUM([Sales]))
9
10-- Rank
11RANK(SUM([Sales]))
12
13-- IF Statement
14IF [Profit] > 0 THEN "Profitable" ELSE "Loss" END
15
16-- CASE Statement
17CASE [Region]
18 WHEN "East" THEN "Atlantic"
19 WHEN "West" THEN "Pacific"
20 ELSE "Central"
21END

7.3. Level of Detail (LOD) Expressions

SQL
1-- Fixed: Calculate at specific level
2{ FIXED [Category] : SUM([Sales]) }
3
4-- Include: Add dimension to calculation
5{ INCLUDE [Product] : AVG([Discount]) }
6
7-- Exclude: Remove dimension
8{ EXCLUDE [Region] : SUM([Profit]) }

8. Hands-on: Build Sales Dashboard

Step-by-step Project

Data: Sample Superstore (included in Tableau)

Dashboard components:

  1. KPI cards (Total Sales, Profit, Orders)
  2. Sales by Category (bar)
  3. Monthly Trend (line)
  4. Regional Map
  5. Top 10 Products table

Sheet 1: Sales by Category

Text
1Columns: Category
2Rows: SUM(Sales)
3Color: Category
4Sort: Descending
5Labels: Show

Sheet 2: Monthly Trend

Text
1Columns: MONTH(Order Date)
2Rows: SUM(Sales)
3Add: SUM(Profit) as dual axis
4Color: Measure Names

Sheet 3: Regional Map

Text
1Double-click: State
2Color: SUM(Sales)
3Size: SUM(Profit)

Sheet 4: Top Products

Text
1Rows: Product Name
2Columns: SUM(Sales)
3Filter: Top 10 by Sales
4Sort: Descending

Combine into Dashboard

Text
1Dashboard → New Dashboard
2Size: Fixed (1200 x 800)
3
4Layout:
5┌─────────────────────────────────────────┐
6│ Sales | Profit | Orders (KPI tiles) │
7├─────────────────┬───────────────────────┤
8│ Sales by │ Monthly Trend │
9│ Category │ │
10├─────────────────┼───────────────────────┤
11│ Regional Map │ Top 10 Products │
12└─────────────────┴───────────────────────┘
13
14Add Filter actions for interactivity!

📝 Quiz

  1. Dimension vs Measure?

    • Dimension = categorical, Measure = numeric
    • Dimension = numeric, Measure = categorical
    • Both are the same
    • Depends on chart type
  2. Cách tạo bar chart đơn giản?

    • Click Insert → Bar Chart
    • Drag dimension to Columns, measure to Rows
    • Right-click → Create Bar
    • Use formula
  3. LOD Expression FIXED làm gì?

    • Fix lỗi trong calculation
    • Calculate at specific dimension level
    • Lock chart position
    • Freeze data
  4. Show Filter dùng để?

    • Hide data
    • Delete rows
    • Let users interactively filter
    • Sort data

🎯 Key Takeaways

  1. Drag and drop - Core interaction của Tableau
  2. Dimensions → Categories, Measures → Numbers
  3. Marks card controls visual encoding
  4. Calculated fields enable custom metrics
  5. Dashboards combine sheets for storytelling

🚀 Bài tiếp theo

Power BI Fundamentals - So sánh với Tableau và build reports trong Power BI Desktop!