Tutorial Gateway

  • C Programming
  • Java
  • R
  • SQL
  • MySQL
  • Python
  • BI Tools
    • Informatica
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • QlikView
  • About
    • About Us
    • Contact Us

Extract Filters in Tableau

16-02-2017 by suresh Leave a Comment

In this article we will show you, How to create Extract Filters in Tableau with example. For this we are going to use the SQL Server Data Source so, Please visit Connecting Tableau to SQL Server article to understand the connection process. Before getting into this, I suggest you to refer Tableau Filters to understand the basic filter techniques.

Create Extract Filters in Tableau

In this example we want to demonstrate the steps involved in creating the extract filters in tableau. Before we start creating filters we need some data. And to get the data, Go to the Data Source, then create Custom SQL Query, or Drag and Drop the tables to extract data from the data base.

For this demo, we are writing the Custom SQL Query on Adventure Works DW database.

Extract Filters in Tableau 1

Custom SQL Query we used in the above data source is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SELECT Geo.EnglishCountryRegionName,
       Geo.StateProvinceName,
       Geo.City,
       Prod.Color,
       Cust.Gender,
       Cust.YearlyIncome,
       Cust.EnglishOccupation,
       Fact.SalesAmount
FROM DimProduct AS Prod
   INNER JOIN
     FactInternetSales AS Fact ON Prod.ProductKey = Fact.ProductKey
   INNER JOIN
     DimCustomer AS Cust ON Fact.CustomerKey = Cust.CustomerKey
   INNER JOIN
     DimGeography AS Geo ON Cust.GeographyKey = Geo.GeographyKey

NOTE: Don’t worry about the code and Joins that we used in the above statement. However, If you are interested in learning SQL Server, Please visit our SQL tutorials page.

In order to create Extract Filters, Change the connection from Live to Extract under the Connection section, and click on the Edit button.

Extract Filters in Tableau 2
Once you click on the Edit Hyperlink, a new window called Extract Data will be opened as shown below. To create our first extract filter, click on the Add.. button.
Extract Filters in Tableau 3
Once you click on the Add.., a new window called Add Filter will be opened. And it contains a list of all the Columns that are available in the Tables. Here you can select the filed on which you want to apply the filter.

Extract Filters on Dimensions

Please select the Dimension filed from the list of available fields, or Columns. From the below screenshot you can observe that, we are selecting the Color Dimension as our filter field.
Extract Filters in Tableau 4
Once you select the Color Dimension filed, a new window called Filter will be opened as shown below. Here we are selecting Black, Blue, Multi, NA, Yellow. It means data source will extract the data whose Color is Black, Blue, Multi, NA, or Yellow. I suggest you to refer Tableau Filters on Dimensions article to understand the properties in the following window.
Extract Filters in Tableau 5
Click OK to close the Extract data window
Extract Filters in Tableau 6
Drag and Drop the English Country Region Name, Color present in the Dimension Region to Rows Shelf, and Sales Amount Measures region to Columns Shelf. As you can see that, our report is displaying the records whose color is Black, Blue, Multi, NA, or Yellow.
Extract Filters in Tableau 7

Remove Extract Filters in Tableau

It is easy to remove the extract filters in tableau. To do so,

  • Within the Data Source go to the Connection section, and click on the Edit hyperlink beside the extract.
  • This will open the list of available extract filters on that data source.
  • Select the required filter and click on the Remove button as we shown below.

Extract Filters in Tableau 8

Extract Filters on Measures

Please select the Measure filed from the list of available fields, or Columns. From the below screenshot you can see that, we are selecting the Sales Amount Measure as our filter field.
Extract Filters in Tableau 9
Once you select the Sales Amount Measure filed, a new window called Filter will opened to create the filter condition. From the demonstration purpose, we are leaving the maximum value as it is, and changed the minimum value to 1,684. I suggest you to refer Tableau Filters on Measures article to understand the properties present in the following window.
Extract Filters in Tableau 10
Click OK to close the Extract Data window
Extract Filters in Tableau 11
Let us create one sample report to show either our newly created extract filter is working or not?. To do so, Drag and Drop the City from Dimension Region to Rows Shelf, and Sales Amount from Measures region to Columns Shelf. For better understanding we sorted the data in Ascending order based on the Sales Amount, and added the Data Label to the Bar chart.
Extract Filters in Tableau 12
As you can see from the above screenshot, Sales Amount of all the records are greater than 1,684

Top Filters using Extract Data

From the below screenshot you can observe that, we are selecting the Top 15 Rows as the filter condition.
Extract Filters in Tableau 13
As you can see that, our data source has 15 rows only.
Extract Filters in Tableau 14
Let me create a sample report by dragging the City from Dimension Region to Rows Shelf, and Sales Amount from Measures region to Columns Shelf. As you can see it is showing 14 records because City East Brisbane is repeated twice in the first 15 rows.
Extract Filters in Tableau 15
Thank You for Visiting Our Blog

Placed Under: Tableau

Share your Feedback, or Code!! Cancel reply

Trending

  • SQL Server Integration Services (SSIS)
  • SQL Server Tutorial
  • SQL Server Reporting Services (SSRS)
  • Home
  • C Program to Calculate the Sum and Average of n Number
  • Tableau
  • C Program to Print Prime Numbers from 1 to 100

Stay in Touch!

Sign Up to receive Email updates on Latest Tutorials

  • Blogger
  • C Programs
  • Java Programs
  • SQL
  • SSIS
  • SSRS
  • Tableau
  • JavaScript

Copyright © 2018 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy