Last Modified Date: 27 Feb 2024
Environment
Tableau DesktopAnswer
The result of these steps can be reviewed in the attached .twbx.
Step 1: Build the View
- In Tableau Desktop, connect to the Superstore sample data.
- Select Data > Connect to Data, and then connect to the Coffee Chain sample data.
- In the Data pane, click the Superstore sample data.
- Drag Region to Rows.
- Drag Sales to Text.
- In the Data pane, click the Coffee Chain sample data.
- Drag State to Rows.
Step 2: Create the Parameter
- Right-click in the Data pane, and then select Create Parameter.
- In the Create Parameter dialog box, do the following, and then click OK:
- Name the parameter. In this example, the parameter is named Search String.
- For Data Type, select String.
- For Current value, enter All.
- For Allowable values, select All.
- Right-click the parameter and then select Show Parameter Control.
Step 3: Create the Filter
- In the Data pane, select the data source to be filtered. In this example, select the Superstore sample data.
- Drag State to Filters.
- On the Condition tab, select By Formula, enter a formula similar to the following, and then click OK:
[Search String] = "All" OR CONTAINS([State],[Search String]).
- Optionally, right-click the dimension on Filters, and then select Apply to Worksheets > All Using This Data Source. Repeat for all data sources to be filtered.
- In the Search String text box, enter in the desired state.
Additional Information
This method is especially useful for filtering across multiple data sources when using blended data.To filter a non-string value, cast the dimension as a string within the conditional filter formula using the STR() function. For example:
[Search String] = "All" OR CONTAINS(STR([<dimension>]),[Search String])
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials