添加链接
注册
登录
link之家
链接快照平台
输入网页链接,自动生成快照
标签化管理网页链接
相关文章推荐
坚强的咖啡豆
·
在Fabric ...
·
9 月前
·
爽快的春卷
·
http - Java ...
·
11 月前
·
冲动的凉茶
·
python jieba.cut ...
·
1 年前
·
近视的花卷
·
教學課程會使用 PowerShell ...
·
1 年前
·
有腹肌的豆腐
·
angular5 - Angular 5 ...
·
1 年前
·
link之家
›
Filter Data Across Multiple Data Sources - Tableau
https://help.tableau.com/current/pro/desktop/en-us/filter_across_datasources.htm
玩篮球的松鼠
6 月前
</noscript><div id="app" class="wrapper"><header id="tableau-help-article-header" class="container--full-width quick-help-header"><div class="container--centered"><div class="header__mobile-menu quick-help-hidden"><menu-tree-toggle/></div><div class="header__logo quick-help-hidden"><a id="tableau-logo" href="https://www.tableau.com/en-us/"><img src="./Resources/tableau-logo.png" class="header__logo__img" alt="Tableau"/></a></div><div class="header__search"><search-header-help placeholder="Search"/></div></div></header><div class="container--navigation-top quick-help-hidden content-only-hidden"><div id="help-subheader" class="subheader print-hidden"><div class="container--centered"><h1 class="heading--subheader">Tableau Desktop and Web Authoring Help</h1></div></div><div class="container--top-links"><div class="container--centered container--breadcrumbs"><div><breadcrumb-links-help/></div></div><div id="help-container-menu-headings" class="container--menu-headings"><nav class="nav-medium-screen"><menu-heading-links-static-help menu-title="In this article" :disabled="false" :headings="pageHeadings"/></nav></div></div></div><div class="section--main container--full-width"><div class="container--centered"><nav class="nav-side nav-side--left" role="navigation"><menu-tree-help menu-title="Contents"/></nav><article role="main"><h2 class="topic--title" id="topic-title">Filter Data Across Multiple Data Sources</h2><div class="caption article__tags content-only-hidden quick-help-hidden"><span class="article__tags--applies-to">Applies to: Tableau Desktop</span><br/><span class="article__tags--role"> </span></div><div id="content-body"> <p>While working with multiple data sources in a workbook, you might want to compare the data between them using a field they have in common. To do so, you can apply a filter across multiple primary data sources.</p> <p>For example, the following dashboard shows the order quantity, average sales, and average profit for customers. It has three views. Each of the views uses a different data source as its primary data source, and those data sources all have a field in common: Customer Name. There is also a filter card in the view for Customer Name.</p> <p>This is an interesting dashboard with a lot of great information, but you might want to update all of the views in the dashboard at the same time by the customer you’re analyzing. For example, maybe you want to see the average sales, profit, and number of orders you’ve received from one of your customers, Aaron Riggs.</p> <p>To do so, you can filter all three data sources on the Customer Name field. </p> <p>Follow the steps below to learn how to filter data across multiple data sources.</p> <h3 is="heading-item" :level="3" id="before-you-start-you-might-want-to-know-the-following">Before you start, you might want to know the following:</h3> <p>Starting with version 10.0, you can filter data across multiple primary data sources. You cannot filter data across secondary data sources. Filtering data across a worksheet's secondary data source is not currently supported in Tableau Desktop. </p> <p>If you want to filter data across secondary data sources, consider the following alternatives:</p> <p>Join tables that are in the same data source, instead of blending them. For more information, see <a href="joining_tables.htm" target="_blank" class="MCXref xref">Join Your Data<span class="sr-only">(Link opens in a new window)</span></a>.</p> <p>Create a cross-database join if your tables are in different data sources. For more information, see <a href="joining_tables.htm" target="_blank" class="MCXref xref">Join Your Data<span class="sr-only">(Link opens in a new window)</span></a>.</p> <p>Make the primary data source the secondary data source, and the secondary data source the primary. <b>Note:</b> This might not always be feasible given the level of detail you want in the final view. </p> <p class="note"><b>Note</b>: To ensure the data strings with mixed capitalization are treated as case-insensitive in the filter, create a calculated field using the UPPER() string function, and then create the filter relationship using that calculated field.</p> <p>For more FAQs about cross data-source filters, see the <a href="https://community.tableau.com/docs/DOC-9111" target="_blank">Cross data-source filtering FAQs<span class="sr-only">(Link opens in a new window)</span></a> forum post in the Tableau Community. </p> <h3 class="step1" is="heading-item" :level="3" id="define-relationships-between-your-data-sources">Define relationships between your data sources</h3> <p>Before you can create relationships between data sources, you must ensure that there is a common field between the data sources you're mapping. The fields do not need to be named the same in each data source, but they should have some data in common. </p> <p>After you've identified the common fields, you must create relationships between them, or <i>map the fields</i> to one another. </p> <p>If the fields happen to have the same name, Tableau might recognize them as related automatically. You can modify an existing relationship that was created automatically by Tableau, or create a new relationship between two fields in different data sources, by following the procedure below.</p> <p>To define a relationship between your two data sources:</p> <p>Select <span class="uicontrol">Data </span>> <span class="uicontrol">Edit Relationships</span>.</p> <p>In the Edit Relationships dialog box, do the following:</p> <p>Select a data source for <span class="uicontrol">Primary data source</span>, and select a data source for <span class="uicontrol"> Secondary data source</span>.</p> <p>Select <span class="uicontrol">Custom</span>.</p> <p>To define a relationship between fields that have different names, click <span class="uicontrol">Add</span>.</p> <p>To edit an existing relationship, select the fields on the right, and then click <span class="uicontrol">Edit</span>.</p> <p>In the Add/Edit Field Mapping dialog box, do the following, and then click <span class="uicontrol">OK</span>:</p> <p>Under <span class="uicontrol">Primary data source field</span>, select a field.</p> <p>Under <span class="uicontrol">Secondary data source field</span>, select a field with similar data to the field you selected for the primary data source.</p> <p>For more information about editing relationships, see <a href="multiple_connections.htm#step4relationships" class="MCXref xref">Blend Your Data</a>. </p> <p><b>Note:</b> After you define your relationships, you do not need to enable blends (that is, you do not have to click the link icon in the <span class="uicontrol">Data</span> pane) to filter across your data sources. </p> <p>For more information about the difference between primary and secondary data sources, see <a href="multiple_connections.htm#primarysecondary" class="MCXref xref">Blend Your Data</a>.</p> <h3 class="step" is="heading-item" :level="3" id="add-a-filter-to-the-view">Add a filter to the view</h3> <p>After you have defined relationships between your data sources, go to one of your worksheets and drag a dimension to the <span class="uicontrol">Filters</span> shelf. Then select to include or exclude data from the view. For more information about filtering your data, see <a href="filtering.htm" target="_blank" class="MCXref xref">Filter Data from Your Views<span class="sr-only">(Link opens in a new window)</span></a>.</p> <p><b>Optional Step</b>: Display a filter card in the view. Right-click the field on the <span class="uicontrol">Filters</span> shelf and select <span class="uicontrol">Show filter</span>. A filter card for that field appears in the view. </p> <p>For more information about filter cards (previously known as quick filters), see <a href="filtering.htm#ShowFilter" target="_blank" class="MCXref xref">Display interactive filters in the view<span class="sr-only">(Link opens in a new window)</span></a>.</p> <h3 class="step" is="heading-item" :level="3" id="apply-the-filter-to-your-worksheets">Apply the filter to your worksheets</h3> <p>After you set up your filter, you can apply that filter to all the worksheets in your workbook that use related data sources, or you can apply it to selected worksheets. </p> <p>To apply the filter to all worksheets that use related data sources, right-click the field on the <span class="uicontrol">Filters</span> shelf and select <span class="uicontrol">Apply to worksheets</span> > <span class="uicontrol">All using related data sources</span>.</p> <p>The Customer Name field is added to the <span class="uicontrol">Filters</span> shelf on every worksheet that uses a related data source. An icon is added next to the field on the <span class="uicontrol">Filters </span>shelf, indicating that the filter is being applied to multiple data sources.</p> <p>If you hover over the field on the Filters shelf in any worksheet, you can find details about the type of filter, the source field for the filter, and the other sheets the filter applies to.</p> <p>To apply the filter to selected worksheets, right-click the field on the <span class="uicontrol">Filters</span> shelf and select <span class="uicontrol">Apply to worksheets</span> > <span class="uicontrol">Selected worksheets</span>.</p> <p>The Customer Name field is added to the <span class="uicontrol">Filters</span> shelf on the worksheets you selected. An icon is added next to the field on the <span class="uicontrol">Filters</span> shelf to indicate that the filter is being applied to select worksheets.</p> <h2 is="heading-item" :level="2" id="source-fields-and-target-fields"><a name="TargetSource"/>Source fields and target fields</h2> <p>When you apply a filter to multiple data sources, you create a source field and one or more target fields. Both source fields and target fields appear on the <span class="uicontrol">Filter</span> shelf in their respective worksheets. </p> <p>The source field is the field you're filtering with. </p> <p>The target field on any given worksheet is a field from another data source that is related to the source field. This is the field that is actually being filtered on that worksheet. </p> <p>The source field determines the data that is included or excluded from the target fields. For example, let's say you have three worksheets that use three separate data sources (A, B, and C) as their primary data source. Each of the data sources has a field in common (Fruit), and the data is as follows:</p> <td style="font-weight: bold;" class="BodyE-Column1-Body1">Fruit from data source A - Source field</td> <td style="font-weight: bold;" class="BodyE-Column1-Body1">Fruit from data source B - Target field</td> <td style="font-weight: bold;" class="BodyD-Column1-Body1">Fruit from data source C - Target field</td> <td class="BodyE-Column1-Body2">Apples</td> <td class="BodyE-Column1-Body2">Apples</td> <td class="BodyD-Column1-Body2">Apples</td> <td class="BodyE-Column1-Body1">Oranges</td> <td class="BodyE-Column1-Body1">Oranges</td> <td class="BodyD-Column1-Body1">Oranges</td> <td class="BodyB-Column1-Body2">Bananas</td> <td class="BodyA-Column1-Body2">Bananas</td>
推荐文章
坚强的咖啡豆
·
在Fabric js中缩放或更改位置时,Fabric.Path对象的object.path不提供更新路径-腾讯云开发者社区-腾讯云
9 月前
爽快的春卷
·
http - Java HttpURLConnection setRequestProperty is not setting custom header key - Stack Overflow
11 月前
冲动的凉茶
·
python jieba.cut 要切分的句子中含有数字怎么办_百度知道
1 年前
近视的花卷
·
教學課程會使用 PowerShell 部署到現有的虛擬網路 - Azure 專用 HSM | Microsoft Learn
1 年前
有腹肌的豆腐
·
angular5 - Angular 5 and CSS Grid - Cannot find grid areas - warning - Stack Overflow
1 年前