BigData / Tableau Interview Questions
What is a context filter, and why would you use one?
A context filter is a filter you promote to run before all other (non-context) filters on the same worksheet, creating a temporary, filtered "context" that every other filter and calculation then operates within.
- Performance: if a worksheet has a filter that dramatically shrinks the data (e.g. Region = "West"), making it a context filter means Tableau only has to evaluate subsequent filters against that smaller subset, instead of the full dataset each time.
- Correctness for dependent filters: a "Top 10 Customers by Sales" filter needs to know the correct universe of customers to rank — if you also want that ranking limited to one region, the region filter must run first, which requires making it a context filter.
Right-click the [Region] filter pill -> "Add to Context"
Context filters aren't free, though: changing a context filter forces Tableau to rebuild the temporary table behind the scenes, which has its own cost, so they're best used for filters that are large, static, and shared across many dependent calculations, not ones that change frequently.
More Related questions...