舉例來說,以 Google Analytics 國家/地區維度為依據的控制項會套用至網頁上所有使用 Google Analytics 資料來源的元件,即使這些元件連結至不同的資料檢視也是如此。這是因為所有 Analytics 資料來源都具有相同的預設欄位組合。(請注意,Analytics 中的選用功能 (例如加強型電子商務) 會產生額外欄位,但這些欄位可能不會出現在所有 Analytics 資料來源中,因此無法與未啟用這些功能的資源或檢視畫面控制項相容)。
如果涉及的圖表是根據不同類型的資料來源建立,則跨資料來源篩選通常無法運作,即使欄位顯示名稱相同也一樣。這是因為篩選作業是根據內部欄位 ID 而非資料來源中的可見欄位名稱進行。(資料來源中建立欄位後,您就無法編輯內部 ID)。
範例
假設報表包含 3 個不同的資料來源:一個來自 Google 試算表,另外兩個來自 Analytics。即使三個資料來源都包含名稱為「Country」的欄位,只有 Analytics 資料來源會共用相同的內部結構。Analytics 圖表的控制項可使用任一資料來源的「國家/地區」維度,但不會篩選 Google 試算表圖表。相反地,以 Google 試算表「國家/地區」維度為依據的控制項會篩選以 Google 試算表為依據的圖表,但不會影響 Analytics 圖表。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-31 (世界標準時間)。"],[],[],null,["# Use controls across data sources\n\nIn a report based on a single data source, a control affects all the charts and other controls in the report. In reports with multiple data sources, how the control works depends on the data sources involved.\n\nAs a general rule, controls can filter charts from different data sources as long as the data sources share the same internal structure (schema). In practice, this means that you can filter across data sources if:\n\na) the data sources were created using the same [connector](/looker/docs/studio/connector), and\n\nb) the data sources have a fixed schema, with a predefined set of fields.\n\nFor example, a control based on the Google Analytics *Country* dimension applies to all components on the page that also use a Google Analytics data source, even if they connect to different views. This is because all Analytics data sources have the same default field set. (Note that optional features in Analytics, such as Enhanced Ecommerce, will produce additional fields that may not exist in all Analytics data sources, and therefore, not be compatible with controls based on properties or views without those features.)\n\nFiltering across data sources generally won't work if the charts involved are based on data sources of different types, even if the fields have the same visible name. This is because filtering is based on the *internal* field IDs, not the visible field names in the data source. (And, once a field has been created in the data source, you can't edit the internal ID.)\n\nExample\n-------\n\nSay you have a report with 3 different data sources: one from Google Sheets, and two from Analytics. Even if all three data sources include a field with the visible name of \"Country,\" only the Analytics data sources share the same internal structure. A control for the Analytics charts can use the *Country* dimension from either data source, but it won't filter the Google Sheets chart. Conversely, a control based on the Sheets *Country* dimension will filter the Sheets-based chart, but won't affect the Analytics charts."]]