Filters vs Parameters

Learning the difference between filters and parameters and their uses.

Filters vs Parameters Interview with follow-up questions

Interview Question Index

Question 1: Can you explain the difference between filters and parameters in Tableau?

Answer:

In Tableau, filters and parameters are both used to control the data displayed in a visualization, but they have different functionalities.

  • Filters are used to restrict the data that is included in a visualization. They allow you to exclude certain data points based on specific criteria, such as a date range, a category, or a measure value. Filters can be applied to individual worksheets or to the entire workbook.

  • Parameters, on the other hand, are dynamic values that can be used to change the behavior of a visualization. They allow users to interact with the visualization by selecting different values or options. Parameters can be used to control various aspects of a visualization, such as the color scheme, the level of detail, or the aggregation method.

Back to Top ↑

Follow up 1: Can you give an example of when you would use a filter over a parameter?

Answer:

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.

Back to Top ↑

Follow up 2: What are some limitations of filters and parameters?

Answer:

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.

Back to Top ↑

Follow up 3: How can parameters enhance the interactivity of a Tableau dashboard?

Answer:

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.

Back to Top ↑

Follow up 4: Can you explain how to create and use a parameter in Tableau?

Answer:

To create a parameter in Tableau, you can follow these steps:

  1. In the Data pane, right-click on an empty space and select 'Create Parameter'.
  2. In the Create Parameter dialog box, specify the name, data type, and allowable values for the parameter.
  3. Optionally, you can add a description, set a default value, or define any other properties for the parameter.
  4. 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.

Back to Top ↑

Question 2: How do you create a parameter in Tableau?

Answer:

To create a parameter in Tableau, you can follow these steps:

  1. In Tableau Desktop, go to the Data pane.
  2. Right-click on an empty space in the Dimensions or Measures area and select 'Create Parameter'.
  3. In the Create Parameter dialog box, specify the name, data type, and other properties of the parameter.
  4. Click 'OK' to create the parameter.

Here is an example of creating a parameter named 'Discount Percentage' with a data type of 'Float':

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 'Discount Percentage' as the name.
4. Select 'Float' as the data type.
5. Click 'OK'.
Back to Top ↑

Follow up 1: What are the different data types you can use when creating a parameter?

Answer:

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'.
Back to Top ↑

Follow up 2: Can you explain how to use a parameter in a calculated field?

Answer:

Yes, you can use a parameter in a calculated field in Tableau. Here is how you can do it:

  1. In Tableau Desktop, go to the Data pane.
  2. Right-click on an empty space in the Dimensions or Measures area and 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 by referencing its name.
  5. 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'.
Back to Top ↑

Follow up 3: What are some use cases for parameters in Tableau?

Answer:

Parameters in Tableau can be used in various ways to enhance data analysis and visualization. Some common use cases for parameters include:

  1. Filtering: Parameters can be used to allow users to dynamically filter data based on specific criteria.
  2. Comparisons: Parameters can be used to compare different scenarios or subsets of data.
  3. Thresholds: Parameters can be used to set thresholds or target values for visualizations.
  4. 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.

Back to Top ↑

Follow up 4: How can you allow users to change the values of a parameter in a Tableau dashboard?

Answer:

To allow users to change the values of a parameter in a Tableau dashboard, you can follow these steps:

  1. In Tableau Desktop, go to the worksheet or dashboard where the parameter is used.
  2. Right-click on the parameter and select 'Show Parameter Control'.
  3. 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.
Back to Top ↑

Question 3: What are some use cases for filters in Tableau?

Answer:

Filters in Tableau are used to limit the data displayed in a visualization based on certain conditions. Some common use cases for filters in Tableau include:

  1. Data exploration: Filters can be used to focus on specific subsets of data, allowing users to analyze and understand the data more effectively.

  2. Data segmentation: Filters can be used to segment data based on different dimensions or measures, enabling users to compare and analyze different subsets of data.

  3. Data drill-down: Filters can be used to drill down into specific levels of detail in the data, allowing users to analyze the data at different levels of granularity.

  4. Data filtering: Filters can be used to exclude or include specific data points based on certain conditions, helping users to focus on the most relevant data for their analysis.

Back to Top ↑

Follow up 1: How do you apply a filter to a visualization in Tableau?

Answer:

To apply a filter to a visualization in Tableau, follow these steps:

  1. Select the visualization you want to apply the filter to.

  2. In the top menu, click on the "Filter" icon (looks like a funnel).

  3. 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.

  4. 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.

  5. 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.

Back to Top ↑

Follow up 2: Can you explain how to create a quick filter in Tableau?

Answer:

To create a quick filter in Tableau, follow these steps:

  1. Select the visualization you want to add the quick filter to.

  2. In the top menu, click on the "Show Me" icon (looks like a chart).

  3. In the "Show Me" pane, click on the "Quick Filter" option.

  4. A quick filter will be added to the visualization, allowing users to interactively filter the data.

  5. 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.

Back to Top ↑

Follow up 3: What is the difference between a quick filter and a normal filter?

Answer:

The main difference between a quick filter and a normal filter in Tableau is the level of interactivity and flexibility they provide:

  1. 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.

  2. 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.

Back to Top ↑

Follow up 4: How can you share filters across multiple worksheets in a Tableau workbook?

Answer:

To share filters across multiple worksheets in a Tableau workbook, you can use the following methods:

  1. 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.

  2. 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.

  3. 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.

Back to Top ↑

Question 4: Can you explain how to use parameters to change the dimensions or measures in a visualization?

Answer:

In Tableau, parameters are dynamic values that can be used to change the dimensions or measures in a visualization. To use parameters in this way, you first need to create a parameter by right-clicking on the 'Data' pane and selecting 'Create Parameter'. Then, you can use the parameter in calculations, filters, or even as a field in the visualization. By changing the value of the parameter, you can dynamically update the dimensions or measures used in the visualization.

Back to Top ↑

Follow up 1: What are some benefits of using parameters in this way?

Answer:

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.

Back to Top ↑

Follow up 2: Can you give an example of when this might be useful?

Answer:

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.

Back to Top ↑

Follow up 3: How can you allow users to change the values of a parameter in a Tableau dashboard?

Answer:

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.

Back to Top ↑

Follow up 4: What are some potential issues or limitations with using parameters in this way?

Answer:

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.

Back to Top ↑

Question 5: What is the difference between a global filter and a local filter in Tableau?

Answer:

A global filter in Tableau is a filter that is applied to all worksheets and dashboards in a workbook. It affects the entire data set and is useful when you want to apply the same filter criteria across multiple visualizations. On the other hand, a local filter is a filter that is applied to a specific worksheet or dashboard. It only affects the data displayed in that particular visualization.

Back to Top ↑

Follow up 1: Can you give an example of when you would use a global filter over a local filter?

Answer:

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.

Back to Top ↑

Follow up 2: How do you create a global filter in Tableau?

Answer:

To create a global filter in Tableau, you can follow these steps:

  1. Select the worksheet or dashboard where you want to create the filter.
  2. Drag the desired field to the Filters shelf.
  3. Right-click on the filter and select 'Apply to Worksheets' or 'Apply to Dashboards'.
  4. 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.

Back to Top ↑

Follow up 3: What are some limitations of global filters?

Answer:

Some limitations of global filters in Tableau include:

  1. Global filters can only be applied to worksheets or dashboards that use the same data source.
  2. Global filters cannot be applied to individual fields within a visualization.
  3. Global filters may impact performance if the data set is large or complex.
  4. Global filters cannot be customized for each worksheet or dashboard, as they apply the same filter criteria to all visualizations.
Back to Top ↑

Follow up 4: How can global filters enhance the interactivity of a Tableau dashboard?

Answer:

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.

Back to Top ↑