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
| Product | Purpose | Cost |
|---|---|---|
| Tableau Desktop | Create visualizations | $70/mo |
| Tableau Public | Free version (public data only) | Free |
| Tableau Server | Share internally | Enterprise |
| Tableau Online | Cloud sharing | $42/user/mo |
| Tableau Prep | Data preparation | Included |
1.2. Installation
For learning: Tableau Public (Free)
- Download từ public.tableau.com
- Install và create account
- Limitation: Saves to public cloud only
For work: Tableau Desktop
- Download trial từ tableau.com
- 14-day free trial
- 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
| Term | Definition |
|---|---|
| Dimension | Categorical data (Region, Category, Date) |
| Measure | Numeric data (Sales, Profit, Quantity) |
| Rows/Columns | Shelves định vị data |
| Marks | Visual elements (bars, lines, points) |
| Filters | Limit data displayed |
| Pages | Animation/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├── Rename3├── Change data type (String, Number, Date)4├── Create calculated field5├── Create group6├── Create hierarchy7├── Hide8└── Split (for text fields)4. Building Basic Charts
4.1. Bar Chart - Category Sales
Steps:
- Drag
Categoryto Columns - Drag
Salesto Rows - Done!
Text
1Sales by Category2 3$800K ┤ ████████4$600K ┤ ████████5$400K ┤ ████ ████████ ████6$200K ┤ ████ ████████ ████7 0 ┼────────────────────────8 Furniture Office Technology9 SuppliesEnhancements:
- Sort: Click sort icon in toolbar
- Color: Drag
Categoryto Color - Labels: Click Label in Marks card
4.2. Line Chart - Sales Trend
Steps:
- Drag
Order Dateto Columns (auto-becomes YEAR) - Click + on date to expand to Quarter or Month
- Drag
Salesto Rows
Text
1Sales Over Time2 3$100K ┤ ╱╲4 $80K ┤ ╱╲ ╱ ╲5 $60K ┤ ╱╲ ╱ ╲ ╱6 $40K ┤ ╱╲ ╱ ╲ ╱7 $20K ┤__╱ ╲╱8 0 ┼────────────────────────9 Q1 Q2 Q3 Q4 Q1 Q2 Q310 2022 20234.3. Scatter Plot - Profit vs Sales
Steps:
- Drag
Salesto Columns - Drag
Profitto Rows - Drag
Categoryto Color
Text
1Profit │ ●2 │ ● ●3 0 ┼─────────●────────────4 │ ● ●5 │ ●6 └─────────────────────────7 Sales8 9● Furniture ● Office ● Technology4.4. Map - Sales by State
Steps:
- Double-click
State(auto-generates map) - Drag
Salesto 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 type5│ ● Color │ ← Color encoding6│ ○ Size │ ← Size encoding7│ Abc Label │ ← Data labels8│ ◐ Detail │ ← Add detail9│ △ Tooltip │ ← Hover info10└────────────────┘5.2. Color Customization
- Click Color in Marks
- Edit Colors
- Choose palette (Sequential, Diverging, etc.)
- Adjust stepped colors
5.3. Tooltips
Default tooltip:
Text
1Category: Technology2Sales: $836,154Custom 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 chart6. Filters
6.1. Filter Types
| Type | How to Add | Use |
|---|---|---|
| Dimension Filter | Drag to Filters | Include/exclude categories |
| Measure Filter | Drag to Filters | Range of values |
| Date Filter | Drag to Filters | Date range |
| Context Filter | Right-click → Add to Context | Filter that applies first |
6.2. Show Filter Control
Text
1Right-click filter → Show Filter2 3┌─────────────────┐4│ Category │5│ ☑ Furniture │6│ ☑ Office Suppl │7│ ☐ Technology │ ← User can toggle8└─────────────────┘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 Field2 3Name: Profit Ratio4Formula: [Profit] / [Sales]7.2. Common Calculations
SQL
1-- Profit Margin2[Profit] / [Sales]34-- Year-over-Year Growth5(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1)67-- Running Total8RUNNING_SUM(SUM([Sales]))910-- Rank11RANK(SUM([Sales]))1213-- IF Statement14IF [Profit] > 0 THEN "Profitable" ELSE "Loss" END1516-- CASE Statement17CASE [Region]18 WHEN "East" THEN "Atlantic"19 WHEN "West" THEN "Pacific"20 ELSE "Central"21END7.3. Level of Detail (LOD) Expressions
SQL
1-- Fixed: Calculate at specific level2{ FIXED [Category] : SUM([Sales]) }34-- Include: Add dimension to calculation5{ INCLUDE [Product] : AVG([Discount]) }67-- Exclude: Remove dimension8{ EXCLUDE [Region] : SUM([Profit]) }8. Hands-on: Build Sales Dashboard
Step-by-step Project
Data: Sample Superstore (included in Tableau)
Dashboard components:
- KPI cards (Total Sales, Profit, Orders)
- Sales by Category (bar)
- Monthly Trend (line)
- Regional Map
- Top 10 Products table
Sheet 1: Sales by Category
Text
1Columns: Category2Rows: SUM(Sales)3Color: Category4Sort: Descending5Labels: ShowSheet 2: Monthly Trend
Text
1Columns: MONTH(Order Date)2Rows: SUM(Sales)3Add: SUM(Profit) as dual axis4Color: Measure NamesSheet 3: Regional Map
Text
1Double-click: State2Color: SUM(Sales)3Size: SUM(Profit)Sheet 4: Top Products
Text
1Rows: Product Name2Columns: SUM(Sales)3Filter: Top 10 by Sales4Sort: DescendingCombine into Dashboard
Text
1Dashboard → New Dashboard2Size: 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
-
Dimension vs Measure?
- Dimension = categorical, Measure = numeric
- Dimension = numeric, Measure = categorical
- Both are the same
- Depends on chart type
-
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
-
LOD Expression
FIXEDlàm gì?- Fix lỗi trong calculation
- Calculate at specific dimension level
- Lock chart position
- Freeze data
-
Show Filter dùng để?
- Hide data
- Delete rows
- Let users interactively filter
- Sort data
🎯 Key Takeaways
- Drag and drop - Core interaction của Tableau
- Dimensions → Categories, Measures → Numbers
- Marks card controls visual encoding
- Calculated fields enable custom metrics
- 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!
