---
schema_version: "1"
id: 4be41ff6f355b8afb430dae26cca6afaffb3aadc867b3ceba0c22725464afc7b
title: 使用關係進行多資料表資料分析
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server/datasource_multitable_normalized.md
canonical_url: https://help.tableau.com/current/server/zh-tw/datasource_multitable_normalized.htm
source_site: help.tableau.com
content_type: documentation
content_hash: ffabe4c346287a52d8f5df351c0ff67a67fdcfdce9b9cb0f5c6c55e1e97468d8
description: Use relationships to combine multiple tables for analysis without flattening them.
---
[跳至主要內容](#main-content)

# 使用關係進行多資料表資料分析

拖曳到資料來源索引標籤畫布上的資料表會使用關係。關係是一種在 Tableau 中合併資料以進行分析的彈性方式。

您可以將關係視為兩個表之間的合約。使用這些資料表中的欄位建立視覺效果時，Tableau 會使用這項合約引入資料，以便建立具有適當聯結的查詢。

在合併資料時，建議您以關係作為優先採用的方法，因為它可備妥資料，並且讓分析更加簡單而直覺化。[在絕對必要時，才使用聯結](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel_faq.htm#can-i-use-joins-between-logical-tables)。請觀看這部 5 分鐘的視訊，進一步瞭解建立關係的基礎知識。

**附註**：此影片中顯示的編輯關係介面與當前版本略有不同，但功能相同。

您可以在以下 Tableau 部落格文章中瞭解關係如何工作的詳情：

- [關係，第 1 部分：在 Tableau 中導入新的資料建模](https://www.tableau.com/about/blog/2020/5/relationships-part-1-meet-new-tableau-data-model)
- [關係，第 2 部分：提示和技巧](https://www.tableau.com/about/blog/2020/5/relationships-part-2-tips-and-tricks)
- [關係，第 3 部分：在多個關聯資料表中提問](https://www.tableau.com/about/blog/2020/6/relationships-part-3-asking-questions-across-multiple-related-tables)

另請參閱[「動作分析」](https://action-analytics.com/library/)中有關關係的影片播客，例如 [Tableau 為何發明關係？](https://action-analytics.com/ep-1-why-did-tableau-invent-relationships/)按一下[內容庫](https://action-analytics.com/library/)中的「影片播客」以查看更多資訊。

在 Tableau 版本 2024.2 及之後版本中，Tableau 資料模型支援透過多重要素關係進行多事實分析與共用維度。有關詳情，請參閱[關於多事實關係資料模型](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_mfr_multiple_base_tables.htm)、[何時使用多事實關係模型](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_mfr_when_to_use.htm)與[建置多事實關係資料模型](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_mfr_build.htm)。

您是否正在建立新的資料來源與工作簿？

將資料表拖曳至「資料來源」頁面畫布中，即可開始建立您的資料來源。

您也可以採用單一資料表做為資料來源，該資料表中包含了進行分析所需的所有維度與度量欄位...

![採用單一資料表分析的資料模型。](/tableau/current/zh-tw/server/zh-tw/Img/data_model_singletableanalysis.gif)

您也可以藉由拖曳出更多的表並定義其關係，建立多資料表的資料來源...

![在資料來源窗格上建立資料關係。](/tableau/current/zh-tw/server/zh-tw/Img/data_model_createrelationship.gif)

觀看這段 1 分鐘的影片，以瞭解如何開始使用關係。

**附註**：此影片中顯示的編輯關係介面與當前版本略有不同，但功能相同。

有關使用關係的詳細資訊，請參閱[與您的資料建立關聯](https://help.tableau.com/current/pro/desktop/zh-tw/relate_tables.htm)、[關係與聯結的不同之處](https://help.tableau.com/current/server/zh-tw/datasource_relationships_learnmorepage.htm)、[Tableau 資料模型](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel.htm)與[建立與定義關係](https://help.tableau.com/current/pro/desktop/zh-tw/relate_tables.htm#create-and-define-relationships)。

有關更多資訊，請參閱[資料來源和分析的變更](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel_whatschanged.htm)以及[有關關係、資料模型和資料來源的問題](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel_faq.htm)。

您開啟的是舊有的工作簿或資料來源？

您在 2020.2 版本中開啟 2020.2 版本之前的工作簿或資料來源時，您的資料來源會在畫布中顯示為一個單一邏輯資料表，名稱為「移轉資料」或原本的表名稱。您的資料會被保留，您可以像之前一樣繼續使用工作簿。

![如果資料來源包含多個已建立聯結或聯集的表，則會顯示名為「移轉資料」的單一邏輯資料表。](/tableau/current/zh-tw/server/zh-tw/Img/data_model_migrated_data.gif)

若要查看組成單一邏輯資料表的實體資料表，請按兩下該邏輯資料表，在實體層中加以開啟。您將看到其基礎實體資料表，包括聯結和聯集。

有關更多資訊，請參閱[資料來源和分析的變更](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel_whatschanged.htm)以及[有關關係、資料模型和資料來源的問題](https://help.tableau.com/current/pro/desktop/zh-tw/datasource_datamodel_faq.htm)。

## 此區段的其他文章