How to implement a Parameter in Tableau that will accept multiple inputs at a time

Blog | December 1, 2022 | By Shaswath Thunga Devaraj URS, Abhishek Ranjan

Mastering Tableau: Implementing Parameters for Multiple Inputs

Enhance Your Tableau Skills: Creating Parameters for Multiple Inputs

Exploring Tableau’s Advanced Features: Multi-Input Parameters Demystified

Introduction

We were working on a project in which the requirement was to pass multiple values as input to the parameter. In the same Project for a few dashboards, we faced challenges while developing the dashboard because of huge data. It was taking too long to execute any command and therefore it was very difficult to build the dashboard either using live connection or using an extract.

To overcome the above problem and meet the requirement, we came up with the below solutions: 

  • By using CONTAINS() Function
  • By using INSTR() Function 

By using CONTAINS() Function

CONTAINS is a Tableau function with the help of which we were able to pass multiple values as input to the parameter.

Understanding Parameters in Tableau

Step-by-Step Guide: Creating a Parameter for Multiple Inputs

Practical Examples: Leveraging Multi-Input Parameters in Tableau

Tips and Tricks: Optimizing Your Analysis with Multi-Input Parameters

Getting Started: Introduction to Tableau Parameters

Creating a Multi-Input Parameter: A Detailed Walkthrough

Applying Multi-Input Parameters: Real-World Use Cases

Advanced Techniques: Maximizing the Potential of Multi-Input Parameters

Please follow the below steps to create a parameter in Tableau which will take multiple values as input. 

Step 1: 

Create a string parameter and default it to blank

Step 2: 

Create a calculated field as below 

Department ID Calc = CONTAINS ([DEPARTMENT ID], (Department ID))  

Here “[DEPARTMENT ID]” is a Tableau Parameter and “Department ID” is the corresponding column from the database to which we want to apply this parameter

Step 3: 

Bring Department ID Calc to filter shelf and filter it to True

Step 4:

Pass multiple values with any delimiter through DEPARTMENT ID parameter

Limitations and workaround for it

  • CONTAINS() Function works only with those fields which are having string data type.  
  • INSTR() function will overcome this limitation.

By using INSTR() Function

For those dashboards in which we were facing challenges because of huge volume of data, we restricted the data by using parameters in custom SQL query. But when we used parameters in custom SQL query,  we were not able to use CONTAINS() function to pass multiple values as input to the parameter. In this case, we used the INSTR() function to meet our requirements. 

NOTE: INSTR() function will work only with the ORACLE database. 

Please follow the below steps to make a parameter in tableau which will take multiple values as input.  

Step 1: 

Fetch the data from the ORACLE database using custom SQL query.

Step: 2

Create a string parameter and default it to blank

Step 3:

Use the INSTR() function and modify the custom SQL query.

Here “<Parameters.DEPARTMENT ID>” is a Tableau Parameter and “DEPARTMENT_ID” is the corresponding column from the database on which we want to apply this parameter. 

Step 4: 

Pass multiple values with any delimiter through the DEPARTMENT ID parameter.

NOTE: If user wants to search data based on only few characters and get the corresponding result, we can follow below approach. 

Step: 1 

Create a string parameter and default it to blank

Step 2:

Use SUBSTR() with INSTR() function and modify the custom SQL query.

Here “<Parameters.Email>” is a Tableau Parameter and “EMAIL” is the corresponding column from the database on which we want to apply this parameter. 

Step 3: 

Pass multiple values with any delimiter through the Email parameter.

About the Author
Shaswath is a highly skilled software engineer with proficiency in Alteryx, Oracle, Snowflake, Teradata, and Tableau. His experience encompasses the information technology and services sector where he applies his expertise in data transformation, analytics, and visualization to provide valuable insights for clients.
Shaswath Thunga Devaraj URSTechnical Lead - Visual Analytics | USEReady
About the Author
Seasoned BI Analyst with proficiency in Tableau Desktop, Alteryx, Power BI, Oracle, and Tableau Prep. An adaptive and agile learner with a penchant for exploring the latest technologies.
Abhishek RanjanBI Analyst - Data Value | USEReady