Lead magnet - project 1.png
  • Bernard

Adding Search Box in Tableau Dashboards

Updated: May 17, 2021

Search box or search bar is a graphical element that acts as the field for query input – for users to search and retrieve related information from the database.

In this short post, I will show you how to create and add a search box in your Tableau dashboards. The main goal is to enable user’s search the various ‘Countries’ within the dashboard rather than scrolling for minutes to find a particular Country.

But first – Let’s build the view from which the users will be searching. My dashboard/view shows Countries by population.

Next – let’s build the search box or bar.

Our search box is simply a parameter, named ‘Search Country’ with a ‘String’ data type, no Current value and one that allows All inputs.

Let’s create the calculation linking our parameter and the view – using the function CONTAINS() as follows.

This formula will return countries containing the phrase searched - in the parameter 'Search Country'. Add this calculation to the filter shelf and select ‘True’. Show parameter control and try searching for different members of the dimension used in the view – Countries & Areas for this case.

The view above returns Countries containing the phrase ‘tu’ searched on the search box -'Search Country'.

Note: Same idea can be replicated by adding a Wildcard Match filter.

How is done;

Drag the dimension you would like to search from – to the filters shelf >> Show Filters >>Choose Wildcard Match

Executing this and searching for phrase ‘man’ returns.

I hope this was helpful to you, to receive more of the Tableau tips and tricks kindly subscribe to our mailing list.

Thanks for reading