MinAI - Về trang chủ
Hướng dẫn
8/1345 phút
Đang tải...

Advanced Tableau

LOD Expressions nâng cao, Analytics pane, Tableau Prep, và performance optimization

0

🎯 Mục tiêu bài học

TB5 min

Sau bài học này, bạn sẽ:

✅ Master LOD Expressions: Cohort, CLV, New vs Returning

✅ Analytics pane: Trend Line, Forecast, Clustering

✅ Tableau Prep basics cho data cleaning

✅ Performance optimization: Extracts, Context Filters

✅ Advanced: Set Actions, Dynamic Zone, Small Multiples

Thời gian: 45 phút | Độ khó: Advanced | Tool: Tableau Desktop

1

📖 Bảng Thuật Ngữ Quan Trọng

TB5 min
Thuật ngữTiếng ViệtMô tả
Cohort AnalysisPhân tích đoàn hệGroup customers by acquisition period
CLVGiá trị vòng đời KHCustomer Lifetime Value
Trend LineĐường xu hướngLinear, polynomial, exponential fit
ForecastDự báoTime-series prediction
ClusteringPhân cụmK-means grouping tự động
Tableau PrepChuẩn bị dữ liệuVisual ETL tool
Extract (.hyper)Trích xuấtLocal data cache cho performance
Context FilterBộ lọc ngữ cảnhFilter ưu tiên, áp dụng trước
Set ActionHành động tập hợpUser select → update set → calcs react
Small MultiplesNhiều biểu đồ nhỏSame chart repeated per category

Checkpoint

LOD = FIXED/INCLUDE/EXCLUDE. Cohort = group by acquisition. Extract (.hyper) = local cache. Context Filter = priority filter. Bạn nhớ 3 loại LOD chưa?

2

🎯 1. LOD Expressions Deep Dive

TB5 min

1.1 Cohort Analysis

Ví dụ
1// Customer Acquisition Year
2{ FIXED [Customer ID] : MIN(YEAR([Order Date])) }
3
4// Use: Color by cohort year → see retention over time

1.2 Customer Lifetime Value

Ví dụ
1// Total revenue per customer
2{ FIXED [Customer ID] : SUM([Sales]) }
3
4// Order frequency
5{ FIXED [Customer ID] : COUNTD([Order ID]) }
6
7// First & Last order
8{ FIXED [Customer ID] : MIN([Order Date]) }
9{ FIXED [Customer ID] : MAX([Order Date]) }
10
11// Active days
12DATEDIFF('day',
13 { FIXED [Customer ID] : MIN([Order Date]) },
14 { FIXED [Customer ID] : MAX([Order Date]) }
15)

1.3 New vs Returning Customers

Ví dụ
1IF [Order Date] = { FIXED [Customer ID] : MIN([Order Date]) }
2THEN "New Customer"
3ELSE "Returning Customer"
4END

1.4 Percent of Parent

Ví dụ
1// Sub-category as % of category
2SUM([Sales]) / { FIXED [Category] : SUM([Sales]) }
3
4// Product as % of total
5SUM([Sales]) / { FIXED : SUM([Sales]) }

LOD Use Cases thực tế: Customer cohort analysis, CLV calculation, New vs Returning segmentation, % of parent. FIXED là powerful nhất — bỏ qua mọi viz filters!

Checkpoint

Cohort = FIXED Customer : MIN(YEAR(Date)). CLV = FIXED Customer : SUM(Sales). New vs Returning = compare Order Date với FIXED MIN. Mỗi LOD giải quyết 1 business question!

3

📊 2. Analytics Pane

TB5 min

2.1 Available Analytics

📊Analytics Pane
📏Summarize: Average, Median, Constant Line
🔮Model: Trend Line, Forecast, Cluster
⚙️Custom: Reference Line/Band, Distribution

2.2 Trend Line

Ví dụ
11. Analytics pane → Drag "Trend Line" onto chart
22. Models: Linear, Logarithmic, Polynomial, Power
33. Options: confidence bands, R-squared

2.3 Forecast

Ví dụ
11. Drag "Forecast" onto line chart
22. Options:
3 - Length: 3, 6, 12 months
4 - Prediction interval: 90%, 95%
5 - Seasonal pattern: Auto-detect

Best for: Sales forecasting, demand planning.

2.4 Clustering

Ví dụ
11. Drag "Cluster" onto scatter plot
22. Number of clusters: Auto or custom (2-10)
33. Result: points colored by cluster

Best for: Customer segmentation, product grouping.

Forecast trong Tableau dùng exponential smoothing — tự detect seasonal patterns. Rất tốt cho quick prediction nhưng không thay thế proper ML models!

Checkpoint

Analytics Pane: Trend Line (regression), Forecast (time-series), Cluster (k-means). Drag-and-drop lên chart — không cần code! Forecast dùng exponential smoothing.

4

🔧 3. Tableau Prep

TB5 min

3.1 Why Tableau Prep?

Before PrepWith Prep
Manual Excel cleanupVisual data cleaning
SQL transformationsDrag-drop operations
Data lives in silosUnion/join multiple sources
Repetitive processSaved & scheduled flows

3.2 Key Operations

OperationUse Case
CleanRename, remove, change types
FilterRemove rows (null, invalid)
GroupMerge similar values (typos)
PivotWide → long format
UnionCombine same-structure tables
JoinCombine different tables on key
AggregateGroup by + summarize
ScriptPython/R for advanced transform

3.3 Typical Prep Flow

Ví dụ
1Input (Excel files)
2
3Clean: Fix column names, data types
4
5Filter: Remove nulls, test data
6
7Join: Customer table + Orders table
8
9Calculate: Add profit margin, segments
10
11Output: Tableau Extract (.hyper)

Checkpoint

Tableau Prep = visual ETL tool. Flow: Input → Clean → Filter → Join → Calculate → Output (.hyper). Saved flows có thể schedule refresh tự động!

5

⚡ 4. Performance Optimization

TB5 min

5.1 Performance Recording

Ví dụ
1Help → Settings → Start Performance Recording
2→ Navigate dashboard → Stop Recording → View bottlenecks

5.2 Optimization Tips

AreaTip
DataUse Extracts (.hyper) instead of Live
FiltersContext filters first, then normal
CalculationsRow-level calcs faster than LOD in some cases
DashboardMax 6-8 sheets per dashboard
DatesDiscrete dates, not continuous
MarksReduce number (< 10K ideal)

5.3 Extract Optimization

Ví dụ
1Data Source → Extract:
21. Add filters to reduce data size
32. Aggregate to visible dimensions
43. Hide unused fields
54. Schedule incremental refresh

Performance killers: Live connections to slow databases, too many marks (>100K), complex LOD stacking, excessive filters. Always use Extracts cho production dashboards!

Checkpoint

Extracts > Live connections. Context Filters áp dụng trước normal filters. Max 6-8 sheets per dashboard. < 10K marks ideal. Performance Recording để debug!

6

🚀 5. Advanced Techniques

TB5 min

5.1 Set Actions

Ví dụ
1Dashboard → Actions → Change Set Values
2Set: [My Set]
3Run on: Select
4Clearing: Remove from set

Use case: User selects items → set updates → calculations react.

5.2 Dynamic Zone Visibility

Ví dụ
11. Create boolean calculated field
22. Control container visibility based on field value
3→ Dynamic dashboard layout!

5.3 Small Multiples

Ví dụ
11. Drag [Category] → Columns
22. Drag [Month] → Columns (nested)
33. Drag [Sales] → Rows
4→ One chart per category, same scale

Checkpoint

Set Actions = interactive set membership. Dynamic Zone = show/hide containers based on logic. Small Multiples = same chart repeated per category — great for comparison!

7

📋 Tổng kết

TB5 min

Kiến thức đã học

Chủ đềNội dung chínhTầm quan trọng
LOD Deep DiveCohort, CLV, New/Returning, % ParentAdvanced analysis
AnalyticsTrend, Forecast, Cluster (built-in)Predictive
Tableau PrepVisual ETL, flows, schedulingData prep
PerformanceExtracts, Context Filters, mark limitsProduction
AdvancedSet Actions, Dynamic Zone, Small MultiplesPremium features

Câu hỏi tự kiểm tra

  1. LOD Expression giải quyết được bài toán gì mà Table Calcs không làm được?
  2. Tableau Prep khác Power Query thế nào?
  3. Context Filter giúp cải thiện performance thế nào?
  4. Set Actions dùng trong trường hợp nào?

Bài tiếp theo: DAX Fundamentals — Chuyển sang Power BI và học DAX!

🎉 Tuyệt vời! Bạn đã master Tableau nâng cao!

Nhớ: LOD + Analytics + Performance = Tableau Pro. Bạn đã sẵn sàng cho bất kỳ dự án Tableau nào!