Filters vs Parameters
Filters vs Parameters Interview with follow-up questions
1. Can you explain the difference between filters and parameters in Tableau?
Filters and parameters are complementary but fundamentally different tools in Tableau.
Filters restrict which data is included in a visualization. They act on the underlying data and reduce the result set before marks are drawn. Filters can be applied to dimensions, measures, or dates, and they can be shown as interactive controls for users. Filter types in Tableau follow an order of operations: extract filters → data source filters → context filters → dimension filters → measure filters → table calculation filters. Filters do not require user input to function — they can be hardcoded or driven by user interaction.
Parameters are user-controlled input variables that hold a single value at a time (a number, string, date, or boolean). A parameter by itself does nothing — it must be wired up to a calculation, filter, reference line, or bin size to have any effect. Parameters give users the ability to change the behavior of a visualization without modifying the underlying data.
| Filters | Parameters | |
|---|---|---|
| Purpose | Restrict/include data | Provide a user-controlled input value |
| Operates on | Data rows | Calculations, filters, reference lines |
| Data type | Tied to a field | Integer, float, string, date, boolean |
| Multiple values | Yes | Single value only |
| Live link to data | Yes | No (requires Dynamic Parameters or manual refresh) |
Common interview follow-up: A parameter used in a calculated field that is placed on the Filters shelf effectively creates a parameterized filter — more flexible than a standard filter because the threshold or dimension choice is user-driven rather than hardcoded.
Follow-up 1
Can you give an example of when you would use a filter over a parameter?
One example of when you would use a filter over a parameter is when you want to exclude certain data points from a visualization based on specific criteria. For instance, if you have a sales dataset and you want to analyze the performance of different regions, you can use a filter to only include data for a specific region, such as 'West'. This allows you to focus on a specific subset of the data.
On the other hand, if you want to allow users to dynamically change the region they are analyzing, you can use a parameter. The parameter can be used to select different regions, and the visualization will update accordingly. This provides more flexibility and interactivity for the users.
Follow-up 2
What are some limitations of filters and parameters?
While filters and parameters are powerful tools in Tableau, they do have some limitations:
Filters can only be applied to the data that is already in the visualization. If you want to filter the data before it is loaded into Tableau, you would need to use a data source filter.
Filters can impact the performance of a visualization, especially if they are applied to large datasets. It is important to optimize the use of filters to ensure smooth and efficient performance.
Parameters can only be used to control certain aspects of a visualization. They cannot be used to filter the data directly. If you need to filter the data based on a parameter, you would need to use calculated fields or other techniques.
Parameters can only have a single value at a time. If you need to select multiple values or create a multi-select parameter, you would need to use a workaround, such as using a string parameter and splitting the values.
Follow-up 3
How can parameters enhance the interactivity of a Tableau dashboard?
Parameters can enhance the interactivity of a Tableau dashboard in several ways:
Parameters allow users to dynamically change the values or options in a visualization. This enables users to explore different scenarios or perspectives without the need to create multiple versions of the same visualization.
Parameters can be used to create interactive filters. By linking a parameter to a filter, users can change the filter criteria directly from the parameter control, providing a more intuitive and user-friendly experience.
Parameters can be used to control various aspects of a visualization, such as the color scheme, the level of detail, or the aggregation method. This allows users to customize the visualization according to their preferences or specific requirements.
Parameters can be used in calculations and formulas, allowing users to perform calculations on the fly and see the results immediately. This enables users to perform ad-hoc analysis and explore different what-if scenarios.
Follow-up 4
Can you explain how to create and use a parameter in Tableau?
To create a parameter in Tableau, you can follow these steps:
- In the Data pane, right-click on an empty space and select 'Create Parameter'.
- In the Create Parameter dialog box, specify the name, data type, and allowable values for the parameter.
- Optionally, you can add a description, set a default value, or define any other properties for the parameter.
- Click 'OK' to create the parameter.
Once the parameter is created, you can use it in various ways:
To use the parameter as a filter, you can right-click on a field in the Filters shelf, go to 'Add to Context', and select the parameter.
To use the parameter in a calculation or formula, you can refer to it by its name and use it like any other field or value.
To create a parameter control, you can right-click on the parameter in the Data pane, go to 'Show Parameter Control', and select the desired control type.
To link the parameter to a filter, you can right-click on the parameter control in the view, go to 'Apply to Worksheets', and select the desired filter.
2. How do you create a parameter in Tableau?
To create a parameter in Tableau Desktop:
- In the Data pane, right-click on any empty area (or click the dropdown arrow at the top) and select "Create Parameter..."
- In the dialog, configure the parameter:
- Name: give it a descriptive name (e.g., "Top N" or "Selected Metric")
- Data Type: Integer, Float, String, Boolean, or Date
- Current Value: the default value when the workbook opens
- Allowable Values: choose from All (free text/number entry), List (predefined options), or Range (min/max with step size)
- For List type, you can type values manually or use "Add values from field" to populate the list from existing data (Dynamic Parameters, available since version 2020.1, let this list refresh automatically)
- Click OK. The parameter appears at the bottom of the Data pane under "Parameters."
Making the parameter usable:
- Right-click the parameter and select "Show Parameter" to display it as an interactive control on the dashboard or worksheet.
- Wire it up in a calculated field, e.g.:
IF [Sales] > [Profit Threshold] THEN "Above" ELSE "Below" END
Example — Top N filter:
- Create an integer parameter named "Top N Customers" with a range of 1–20
- Create a calculated field:
RANK(SUM([Sales])) <= [Top N Customers] - Use that field as a filter
Gotcha: Parameters hold a single value and are not automatically linked to the data. Use Dynamic Parameters (2020.1+) if you need the list of available values to stay in sync with the data source.
Follow-up 1
What are the different data types you can use when creating a parameter?
When creating a parameter in Tableau, you can choose from the following data types:
- Integer: Represents whole numbers.
- Float: Represents decimal numbers.
- String: Represents text values.
- Date: Represents dates.
- Boolean: Represents true or false values.
Here is an example of creating a parameter with a data type of 'String':
1. Right-click on an empty space in the Dimensions or Measures area.
2. Select 'Create Parameter'.
3. In the Create Parameter dialog box, enter a name for the parameter.
4. Select 'String' as the data type.
5. Click 'OK'.
Follow-up 2
Can you explain how to use a parameter in a calculated field?
Yes, you can use a parameter in a calculated field in Tableau. Here is how you can do it:
- In Tableau Desktop, go to the Data pane.
- Right-click on an empty space in the Dimensions or Measures area and select 'Create Calculated Field'.
- In the Calculated Field dialog box, enter a name for the calculated field.
- Use the parameter in the calculation by referencing its name.
- Click 'OK' to create the calculated field.
Here is an example of using a parameter named 'Discount Percentage' in a calculated field:
1. Right-click on an empty space in the Dimensions or Measures area.
2. Select 'Create Calculated Field'.
3. In the Calculated Field dialog box, enter a name for the calculated field.
4. Use the parameter in the calculation, for example: [Sales] * [Discount Percentage].
5. Click 'OK'.
Follow-up 3
What are some use cases for parameters in Tableau?
Parameters in Tableau can be used in various ways to enhance data analysis and visualization. Some common use cases for parameters include:
- Filtering: Parameters can be used to allow users to dynamically filter data based on specific criteria.
- Comparisons: Parameters can be used to compare different scenarios or subsets of data.
- Thresholds: Parameters can be used to set thresholds or target values for visualizations.
- What-if analysis: Parameters can be used to perform what-if analysis by allowing users to change input values and see the impact on the results.
These are just a few examples, and the use cases for parameters in Tableau are not limited to these. The flexibility and versatility of parameters make them a powerful tool for data analysis and visualization.
Follow-up 4
How can you allow users to change the values of a parameter in a Tableau dashboard?
To allow users to change the values of a parameter in a Tableau dashboard, you can follow these steps:
- In Tableau Desktop, go to the worksheet or dashboard where the parameter is used.
- Right-click on the parameter and select 'Show Parameter Control'.
- The parameter control will be added to the worksheet or dashboard, allowing users to interact with it and change its value.
Here is an example of allowing users to change the values of a parameter named 'Discount Percentage' in a Tableau dashboard:
1. Right-click on the 'Discount Percentage' parameter.
2. Select 'Show Parameter Control'.
3. The parameter control will be added to the dashboard, and users can now interact with it to change its value.
3. What are some use cases for filters in Tableau?
Filters in Tableau are versatile tools used across many analysis scenarios. Common use cases include:
Date range filtering: Restricting a dashboard to a rolling 12-month window or a specific fiscal quarter, often using relative date filters so they update automatically as time passes.
Audience-specific views: Showing only the data relevant to a particular team, region, or business unit — for example, filtering a sales dashboard to display only the records belonging to the logged-in user's territory.
Outlier removal: Excluding known data quality issues, test records, or statistical outliers from the view without deleting them from the underlying data source.
Top/Bottom N analysis: Using measure filters or sets to focus a visualization on the highest or lowest performers (e.g., top 10 products by revenue).
Dashboard interactivity: Exposing filters as interactive controls (quick filters) so end users can self-serve and slice the data by category, region, time period, or other dimensions without needing Tableau Desktop.
Context filters: Setting a primary filter as a "context filter" (blue funnel icon) so that dependent dimension or top-N filters are computed only against the already-filtered subset, improving both accuracy and performance.
Data source and extract filters: Limiting the data pulled into Tableau at the source level to reduce extract size and improve load times — especially useful with large databases.
Key interview point: Filters follow a strict order of operations in Tableau (extract → data source → context → dimension → measure → table calculation). Understanding this order is important for diagnosing why a filter may not behave as expected.
Follow-up 1
How do you apply a filter to a visualization in Tableau?
To apply a filter to a visualization in Tableau, follow these steps:
Select the visualization you want to apply the filter to.
In the top menu, click on the "Filter" icon (looks like a funnel).
A filter pane will appear on the left side of the screen. Drag and drop the desired dimension or measure from the data pane onto the filter pane.
Configure the filter by selecting the desired options, such as the filter type (e.g., categorical, range), the values to include or exclude, and any additional conditions.
Click the "Apply" button to apply the filter to the visualization.
Note: You can also right-click on a dimension or measure in the visualization and select "Filter" to quickly apply a filter to that specific field.
Follow-up 2
Can you explain how to create a quick filter in Tableau?
To create a quick filter in Tableau, follow these steps:
Select the visualization you want to add the quick filter to.
In the top menu, click on the "Show Me" icon (looks like a chart).
In the "Show Me" pane, click on the "Quick Filter" option.
A quick filter will be added to the visualization, allowing users to interactively filter the data.
To configure the quick filter, click on the drop-down arrow on the quick filter and select the desired options, such as the filter type (e.g., single value, multiple values), the values to include or exclude, and any additional conditions.
Note: Quick filters are interactive and can be used by end users to dynamically filter the data in a visualization.
Follow-up 3
What is the difference between a quick filter and a normal filter?
The main difference between a quick filter and a normal filter in Tableau is the level of interactivity and flexibility they provide:
Quick filters: Quick filters are interactive filters that allow end users to dynamically filter the data in a visualization. They are easy to create and provide a user-friendly interface for filtering the data. Quick filters can be added to a visualization with just a few clicks and can be easily customized by end users.
Normal filters: Normal filters provide more advanced filtering capabilities and flexibility. They can be used to apply complex filtering conditions, create calculated filters, and use parameters for filtering. Normal filters offer more control over the filtering process but may require more configuration and setup compared to quick filters.
Follow-up 4
How can you share filters across multiple worksheets in a Tableau workbook?
To share filters across multiple worksheets in a Tableau workbook, you can use the following methods:
Global filters: Tableau allows you to create global filters that can be applied to multiple worksheets within a workbook. To create a global filter, right-click on a filter in the filter pane and select "Apply to Worksheets" > "Selected Worksheets". Then, choose the worksheets where you want the filter to be applied.
Dashboard filters: You can create a dashboard in Tableau and add multiple worksheets to it. By applying a filter to the dashboard, the filter will be applied to all the worksheets within the dashboard. To create a dashboard filter, select the filter in the filter pane and click on the "Add to Context" button.
Parameters: Parameters can be used to create dynamic filters that can be shared across multiple worksheets. By creating a parameter and using it in calculated fields or filters, you can control the filtering behavior across different worksheets.
4. Can you explain how to use parameters to change the dimensions or measures in a visualization?
Parameters can be used to let users dynamically swap the dimension or measure displayed in a visualization, creating flexible, reusable dashboards without needing separate sheets for each combination.
Swapping measures with a parameter:
- Create a string parameter (e.g., "Select Metric") with a list of allowable values: "Sales", "Profit", "Quantity".
- Create a calculated field that returns the appropriate measure based on the parameter:
IF [Select Metric] = "Sales" THEN [Sales] ELSEIF [Select Metric] = "Profit" THEN [Profit] ELSE [Quantity] END - Place this calculated field on the view (Rows, Columns, or Color) instead of the original measure. Show the parameter control so users can switch between metrics.
Swapping dimensions with a parameter:
- Create a string parameter (e.g., "Group By") with values: "Category", "Region", "Segment".
- Create a calculated field:
IF [Group By] = "Category" THEN [Category] ELSEIF [Group By] = "Region" THEN [Region] ELSE [Segment] END - Place this calculated field on Rows or Columns. When the user changes the parameter, the axis or header updates accordingly.
Gotcha: Calculated fields that swap dimensions return string values, which means they lose any sort order from the original field. You may need an additional sort calculation to preserve ordering. Also, axis labels will reflect the calculated field name rather than the original field name — rename the calculated field dynamically using a label trick or annotation if labeling matters.
Follow-up 1
What are some benefits of using parameters in this way?
Using parameters to change the dimensions or measures in a visualization offers several benefits. Firstly, it allows users to interact with the visualization and explore different perspectives by changing the parameter value. This can lead to better insights and understanding of the data. Secondly, it provides flexibility and scalability as the same visualization can be used with different dimensions or measures without the need to create multiple versions of the visualization. Lastly, it enables the creation of dynamic dashboards where users can customize the visualization according to their needs.
Follow-up 2
Can you give an example of when this might be useful?
One example of when using parameters to change dimensions or measures in a visualization might be useful is in a sales dashboard. Let's say you have a bar chart that shows the total sales by product category. By using a parameter, you can allow users to switch between different dimensions such as product category, region, or customer segment. This allows users to analyze the sales data from different perspectives without the need to create separate visualizations for each dimension.
Follow-up 3
How can you allow users to change the values of a parameter in a Tableau dashboard?
To allow users to change the values of a parameter in a Tableau dashboard, you can add a parameter control to the dashboard. To do this, go to the 'Dashboard' pane, drag and drop the parameter onto the dashboard, and choose the desired control type (e.g., dropdown, slider, etc.). Users can then interact with the control to change the parameter value, which will dynamically update the visualization based on the new value.
Follow-up 4
What are some potential issues or limitations with using parameters in this way?
While using parameters to change dimensions or measures in a visualization can be powerful, there are some potential issues or limitations to be aware of. Firstly, parameters can only be used to change discrete values, so they may not be suitable for continuous or range-based dimensions or measures. Secondly, using parameters can increase the complexity of the calculations and logic in the visualization, which may require additional effort to set up and maintain. Lastly, parameters may introduce performance issues if the visualization needs to handle a large amount of data or complex calculations.
5. What is the difference between a global filter and a local filter in Tableau?
In Tableau, the distinction between a global filter and a local filter comes down to scope — which worksheets the filter affects.
Local filter (default behavior): A filter placed on the Filters shelf of a worksheet applies only to that single worksheet. Other sheets in the workbook, even those using the same data source, are unaffected.
Global filter (cross-sheet filter): A filter can be extended to apply to multiple worksheets that share the same data source. To do this, right-click the filter on the Filters shelf and choose "Apply to Worksheets", then select one of:
- All Using This Data Source: applies to every sheet connected to the same data source
- All Using Related Data Sources: extends to sheets using related or blended sources
- Selected Worksheets: choose specific sheets manually
Common use case for global filters: Dashboard filters. When you add a quick filter on a dashboard, you typically want it to affect all worksheets simultaneously. Setting the filter to "All Using This Data Source" achieves this.
Important distinction: A filter applied via "Apply to Worksheets > All Using This Data Source" is different from a true data source filter. A data source filter (set at the data source level) limits data before any worksheet processing. A global worksheet filter still operates at the worksheet filter level in the order of operations — it is just shared across sheets.
Gotcha: If two sheets use different data sources, a filter on one will not automatically apply to the other. You would need filter actions or a shared data source to coordinate filtering across them.
Follow-up 1
Can you give an example of when you would use a global filter over a local filter?
One example of when you would use a global filter over a local filter is when you have multiple worksheets or dashboards that need to be filtered by the same criteria. For instance, if you have a workbook with multiple visualizations showing sales data for different regions, you can use a global filter to filter all the visualizations by a specific region. This allows you to easily switch between different regions and see the corresponding data in all the visualizations.
Follow-up 2
How do you create a global filter in Tableau?
To create a global filter in Tableau, you can follow these steps:
- Select the worksheet or dashboard where you want to create the filter.
- Drag the desired field to the Filters shelf.
- Right-click on the filter and select 'Apply to Worksheets' or 'Apply to Dashboards'.
- Choose the option 'All Using This Data Source' to apply the filter globally.
Once the global filter is created, it will be applied to all the worksheets or dashboards that use the same data source.
Follow-up 3
What are some limitations of global filters?
Some limitations of global filters in Tableau include:
- Global filters can only be applied to worksheets or dashboards that use the same data source.
- Global filters cannot be applied to individual fields within a visualization.
- Global filters may impact performance if the data set is large or complex.
- Global filters cannot be customized for each worksheet or dashboard, as they apply the same filter criteria to all visualizations.
Follow-up 4
How can global filters enhance the interactivity of a Tableau dashboard?
Global filters can enhance the interactivity of a Tableau dashboard by allowing users to dynamically filter the data displayed in multiple visualizations. Users can easily change the filter criteria and see the updated results across all the visualizations in real-time. This enables them to explore the data from different perspectives and gain deeper insights. Additionally, global filters provide a consistent filtering experience across the dashboard, making it more user-friendly and intuitive.
Live mock interview
Mock interview: Filters vs Parameters
- Read your scene and goals
- Talk it out; goals tick off live
- Get a score and stronger lines
Your voice and your AI key never touch our servers; the key stays in this browser and is sent only to Google. Only your round scores are saved to track progress.