EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Tableau Tutorial Tableau Context Filter
Secondary Sidebar
Tableau Tutorial
  • Sort/Filters
    • Sorting in Tableau
    • Filters in Tableau
    • Types of Filters in Tableau
    • Tableau Action Filter
    • Context Filter in Tableau
    • Tableau Parameter Filter
    • Adding Filters in Tableau Dashboard
    • Tableau Context Filter
  • Basic
    • What is Tableau
    • What is Tableau Dashboard
    • What is Tableau Server
    • Uses of Tableau
    • Tableau Versions
    • Tableau Architecture
    • Is Tableau Free
    • Tableau New Features
    • How To Install Tableau
    • How to Use Tableau?
    • Install Tableau Server
    • Tableau Commands
  • Charts
    • Tableau Charts
    • Tableau Bar Chart
    • Tableau Chart Types
    • Donut Chart in Tableau
    • Tableau Gauge Chart
    • Funnel Chart in Tableau
    • Gantt Chart in Tableau
    • Bubble Chart in Tableau
    • Pareto Chart in Tableau
    • Sankey Chart In Tableau
    • Stacked Bar Chart in Tableau
    • Tableau Bullet Chart
    • Waterfall Chart in Tableau
    • Line Chart in Tableau
    • Heat Map in Tableau
    • Histogram in Tableau
    • CrossTab in Tableau
    • Treemap in Tableau
    • Trend Lines in Tableau
    • Tableau Reference Lines
    • Tableau Dual Axis
    • Legend in Tableau
    • Pie Chart in Tableau
    • Tableau Storyline
  • Statement
    • Tableau IF Statement
    • Case Statement in Tableau
  • Functions
    • Tableau Functions
    • Tableau String Functions
    • Concatenate in Tableau
    • Rank Function in Tableau
    • Tableau Aggregate Functions
    • Window Sum Tableau
    • LOD Expressions in Tableau
    • LOOKUP Function in Tableau
    • Tableau Fixed Function
    • Tableau Count Distinct
    • Tableau Window Functions
  • Tableau Dashboard
    • Dashboard in Tableau
    • Tableau Dashboard Examples
    • Tableau Dashboard Creation
    • Tableau Dashboard Design
    • Tableau Workbook
  • Advanced
    • Tableau Bins
    • Tableau 3D
    • Tableau Export to Excel
    • Tableau Reporting
    • Tableau Reader
    • Tableau Map
    • Tableau Viewer
    • Tableau Prep Builder
    • Tableau Bridge
    • Tableau Tooltip
    • Tableau Hyper
    • Tableau Zen Master
    • Tableau Union
    • Tableau Templates
    • Tableau Alerts
    • Tableau Reporting Tool
    • Conditional Formatting in Tableau
    • Tableau Web Data Connector
    • Tableau BI Tool
    • Data Blending in Tableau
    • Parameters in Tableau
    • Tableau Data Sets
    • Creating Set in Tableau
    • Tableau Drill Down
    • Tableau Dynamic Parameters
    • Tableau Table Calculation
    • Tableau Visualization
    • Tableau Joins
    • Pivot in Tableau
    • Data Visualization With Tableau
    • Forecast in Tableau
    • Map Layers in Tableau
    • Group in Tableau
    • Tableau Group by
    • Hierarchy in Tableau
    • Sets in Tableau
    • How to create a Set in Tableau
    • Tableau Order of Operations
    • Tableau User Group
    • Tableau Calculated Field
    • Custom SQL in Tableau
  • Interview Questions
    • Tableau Interview Questions

Related Courses

Tableau Certification Course

Business Intelligence Courses

Data Visualization Courses

Tableau Context Filter

By Priya PedamkarPriya Pedamkar

Tableau Context Filter

What is Tableau Context Filter?

Tableau Context Filter is a special type of filter that controls the data for the other filters. Whereas the normal filters are generally processed all the data rows from data source independent of the associated filters. Tableau creates a temporary table to process the context filter data that is the reason the context filters in Tableau are also known as dependent filters. The context filter is used to improve the processing performance. It is a recommended filter condition in Tableau for large datasets for creating visualizations. The Tableau Context filter should include in the visualization design before adding other filters for optimizing performance.

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

  • 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

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

  • 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:

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
Popular Course in this category
Tableau Training (8 Courses, 8+ Projects)
  8 Online Courses |  8 Hands-on Projects |  55+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,408 ratings)
Business Intelligence Training (12 Courses, 6+ Projects)4.9
Data Visualization Training (15 Courses, 5+ Projects)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
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

ISO 10004:2018 & ISO 9001:2015 Certified

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

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more