• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer
EDUCBA

EDUCBA

MENUMENU
  • Resources
        • Data & Analytics Career

          • Big Data Analytics Jobs
          • Hadoop developer interview Questions
          • Big Data Vs Machine Learning
        • Data and Analytics Career
        • Interview Questions

          • Career in Cloud Computing Technology
          • Big Data interview questions
          • Data Scientist vs Machine Learning
        • Interview Questions
        • Machine Learning

          • What is Machine Learning
          • Machine Learning Tools
          • Neural Network Algorithms
        • Head to Head Differences
        • Others

          • Resources (A-Z)
          • Data and Analytics Basics
          • Business Analytics
          • View All
  • Free Courses
  • All Courses
        • Certification Courses

          Data Science Course
        • All in One Bundle

          All-in-One-Data-Science-Bundle
        • Machine Learning Course

          Machine-Learning-Training
        • Others

          • Hadoop Certification Training
          • Cloud Computing Training Course
          • R Programming Course
          • AWS Training Course
          • SAS Training Course
          • View All
  • 360+ Courses All in One Bundle
  • Login

Tableau Context Filter

Home » Data Science » Blog » Data Visualization » Tableau Context Filter

Tableau Context Filter

What is Tableau Context Filter?

All the normal filters in Tableau are processed separately. It means each of the filters accesses and reads all the rows from the data source whenever you apply a filter, regardless of other filters, and creates its own result. However, in certain requirements, you might want the filters only to process the output of the previous filters. You can apply more than one unconditional filter as Context Filters in such situations for creating the view. Context filter only processes the data that passes through them by creating separate temporary data set, so they are also referred to as Dependent Filters.

Creating Context Filters

  • Create a filter on which you want to create a context filter, by dragging the dimension to the filter shelf. In the following example, ShipMode and Region are the dimensions in the filter shelf.

Ship Mode

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

  • Right-click on it and select Add to Context option from the context menu of the existing filter. In this example right-click on the ShipMode dimension and select Add to Context option from the general tab as shown below:

Add to Context option

  • Context filter appears at the top of the Filters shelf.
  • These filters cannot be rearranged in anyways.
  • Also, once a filter has become a Context filter, it can be identified by a Grey color in the filter shelf.
  • In the example, after adding Context filter to the ShipMode its color got changed to grey as shown below:

Tableau Context Filter-1.3

  • In the example, the ShipMode dimension has become the context filter. And the Region filter is now calculated using the data that passes through the Ship Mode.

Removing Context Filters

  • To remove the context filter, you can right-click on the dimension and select Remove from Context option from the general tab as shown below:

Remove from Context

  • Now the color will change back to blue as an indication.
  • When you remove the context filter, a new context is computed if any other context filter is remaining on the filter shelf.
  • After removing the context filter, the filter remains on the filter shelf as a standard filter.
  • Whenever you are editing a Context Filter, a new context is computed each time.

Example of Tableau Context Filter

You can consider the superstore sample data set below for the following example.

Tableau Context Filter-1.5

  • This example gives you an idea about the creation and usages of the Context filter.
  • First, you can create a normal view and filter the top ten products based on the sale.
  • Then, add a context filter on the product category dimension.
  • Context filter filters the view and shows the top 10 furniture products.

Step 1: Using the SuperstoreSample data set, create an initial view showing the sub-category sales, which is sorted in the descending order of the sales as shown below:

Tableau Context Filter-1.6

Step 2: Now show the products which are top-selling by creating a top 10 filter:

  • Add the field Sub-Category to the filter shelf.
  • Right-click on the Sub-Category field and select the Top.
  • Now select By field.
  • Now choose the Top 10 Sale Sum as shown in the following screenshot:

Tableau Context Filter-1.7

  • Click OK when you are done.

Step 3: Now the view is filtered to show only the top 10 product sub-categories by Sale as shown below:

Tableau Context Filter-1.8

Step 4: Now you may add one more filter to show one product category, say Furniture.

  • Drag the field Category to the filter shelf.
  • Select Furniture.
  • Click OK when you are done.

The filtered view is shown as in the below screenshot:

Popular Course in this category
Data Visualization Training (15 Courses, 5+ Projects) 15 Online Courses | 5 Hands-on Projects | 105+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (2,345 ratings)
Course Price

View Course

Related Courses
QlikView Training (2 Courses)MatPlotLib Tutorials (3 Courses, 1 Project)

Tableau Context Filter-1.9

  • The filtered view now shows only 3 products instead of 10, because all the filters are independent and are calculated individually.
  • From this view, we can see that three products out of the top 10 are furniture.

Step 5: Using Context Filter on Category, we can find the top ten products.

  • Right-click on the Category dimension on the filter shelf then choose to Add to Context option.
  • Now you can see the change in color to grey as identification of Context Filter.
  • Also, now you can see only the top four products of furniture from the view because there are only four furniture products in the sub-categories.
  • The view can be shown as below:

Tableau Context Filter-1.10

Advantages of Tableau Context Filter

The advantages of Tableau Context Filter are explained below:

1. Improve Performance

  • When you are using many filters simultaneously or you are working on huge data sets, the queries can be slow.
  • Context filters can be used in such situations to improve performance because it creates temporary data sets based on the filter criteria.
  • The selection of major categorical context filters helps you to effectively improve the performance.

2. Dependent Filter Condition

  • Context filters can be used to set dependent filter conditions based on your requirements.
  • Context filters should be given priority when the data source is huge.
  • You can set context filters to get the data of interest alone, and then set a dependent numerical or top N filter.

Performance Improvement of Tableau Context Filter

  • Using a filter that reduces the size of the data set much significantly is better than using multiple filters simultaneously.
  • If a filter is unable to reduce the size of data sets by one-tenth or more, then its advisable to not use a filter on such data sets because it affects performance very badly.
  • All the data modeling should be completed before applying the filter because each change in the data model, for example, converting the dimensions to measures requires recomputing of the contest every time.
  • Use continuous dates if you are setting context on date fields. Using date formats like YEAR (date) or context filter on discrete type dates are also effective.
  • You should set all the necessary filters for the context and should create the context before adding fields to the other shelves. It makes the queries run much faster when other shelf fields are dropped.
  • Context filters cannot provide performance improvement if your data sets are heavily indexed. It decreases performance.

Conclusion

Context filters are used to improve your query performance. Context filters reduce the size of your data sets to one-tenth or even more. The selection of the number of context filters is also very crucial for the performance. Selecting the type of joins is also important for performance improvement.

Recommended Articles

This is a guide to Tableau Context Filter. Here we discuss how to create and remove context filters, examples and advantages of context filters. You may also look at the following articles to learn more –

  1. Tableau Storyline(Creating Story )
  2. Tableau Table Calculation
  3. Tableau Dashboard Creation(Concept and Examples)
  4. Tableau Visualization-Types, Advantages
  5. Complete guide to Pivot in Tableau
  6. PHP Change Date Format
  7. Tableau Bullet Chart
  8. Introduction to Features and Attributes of Tableau

All in One Data Science Bundle (360+ Courses, 50+ projects)

360+ Online Courses

50+ projects

1500+ Hours

Verifiable Certificates

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Reader Interactions
Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar
Data Analytics Tutorials Tutorials
  • Data Visualization
    • QlikView Set Analysis
    • Pareto Chart in Tableau
    • Tableau Dynamic Parameters
    • QlikView Functions
    • Tableau Context Filter
    • Tableau Versions
    • Tableau Bullet Chart
    • Tableau Aggregate Functions
    • Conditional Formatting in Tableau
    • Rank Function in Tableau
    • Trend Lines in Tableau
    • Pivot in Tableau
    • Tableau Drill Down
    • Adding Filters in Tableau Dashboard
    • Tableau Data Sets
    • Types of Filters in Tableau
    • CrossTab in Tableau
    • Case Statement in Tableau
    • Sankey Chart In Tableau
    • Benefits of Data Visualization
    • Donut Chart in Tableau
    • Histogram in Tableau
    • Creating Set in Tableau
    • What is Tableau Dashboard?
    • Types of Data Visualization
    • Tableau Chart Types
    • Tableau Dashboard Creation
    • Tableau Table Calculation
    • Tableau Storyline
    • Tableau Reference Lines
    • Tableau Visualization
    • Tableau Competitors
    • Sorting in Tableau
    • Parameters in Tableau
    • Tableau String Functions
    • Line Chart in Tableau
    • Data Blending in Tableau
    • Tableau Charts
    • Tableau Functions
    • Forecast in Tableau
    • Tableau Joins
    • How to Use Tableau?
    • Data Warehouse Modeling
    • Bubble Chart in Tableau
    • Filters in Tableau
    • Best Data Visualization Tools
    • Tableau Architecture
    • Funnel Chart in Tableau
    • Tableau Alternatives
    • Stacked Bar Chart in Tableau
    • Visual Analytics vs Tableau
    • Treemap in Tableau
    • Gantt chart in Tableau
    • Data Visualization With Tableau
    • Data visualisation vs Data analytics
    • Data Visualization vs Business Intelligence
    • Tableau vs Microstrategy
    • Data Mining Vs Data Visualization
    • Tableau vs QlikView
    • Tableau vs Spotfire
    • QlikView vs QlikSense
    • Power BI Dashboard vs Report
    • Power BI vs Tableau
    • Power BI vs SSRS
    • Data Science vs Data Visualization
    • Tableau vs Domo
    • Looker vs Tableau
    • Splunk vs Tableau
    • Power BI vs QlikView
    • Uses of Tableau
    • Tableau Commands
    • What is Tableau Server
    • Power BI vs Excel
    • Power BI vs Tableau vs Qlik
    • Is Tableau Free
    • What is Data Visualization
    • How To Install Tableau
    • Is Power BI Free
    • What is Microsoft Power BI
    • Data Visualization Tools
    • What is QlikView
    • How to create a Set in Tableau
    • What is Tableau
    • QlikView Tools
    • Tableau Date Functions
    • Tableau IF Statement
    • Heat Map in Tableau
    • Waterfall Chart in Tableau
  • Big Data (151+)
  • Business Analytics (40+)
  • Cloud Computing (82+)
  • Data Analytics Basics (202+)
  • Data Analytics Careers (36+)
  • Data Mining (30+)
  • Interview Questions (50+)
  • Machine Learning (141+)
  • Statistical Analysis (36+)
  • Data Commands (4+)
  • Power Bi (6+)
Data Analytics Tutorials Courses
  • Data Visualization Training
  • QlikView Training
  • MatPlotLib Tutorials
Footer
About Us
  • Who is EDUCBA?
  • Sign Up
  •  
Free Courses
  • Free Course on Data Science
  • Free Course on Machine Learning
  • Free Coruse on Statistics
  • Free Course on Data Analytics
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course
  • Tableau Training
  • Azure Training Course
  • IoT Course
  • Minitab Training
  • SPSS Certification Course
  • Data Science with Python Course
Resources
  • Resources (A To Z)
  • Data & Analytics Career
  • Interview Questions
  • Data Visualization
  • Data and Analytics Basics
  • Cloud Computing
Apps
  • iPhone & iPad
  • Android
Support
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions

© 2019 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

Let’s Get Started
Please provide your Email ID
Email ID is incorrect

Limited Period Offer - All in One Data Science Bundle (360+ Courses, 50+ projects) View More

Limited Period Offer - Limited Period Offer - All in One Data Science Bundle (360+ Courses, 50+ projects) View More