Category / Section
How to change table name using dashboard parameter in Bold BI
Published:
In Bold BI, you can use dashboard parameters to dynamically select different tables in your data source. This allows you to easily switch between tables without having to modify the query itself. In this article, we will demonstrate how to create a List type dashboard parameter and use it to select different tables based on the parameter value.
Step 1: Create a List Type Dashboard Parameter
- Create data source
- Click on the Parameters icon in the toolbar.
- Set the Name of the parameter and choose the Type as
List
. - Select the column which has the table names in Value field
- Check the Set first value. By checking this which returns the first value in the list of values.
- Click Save to create the parameter.
Step 2: Use the Dashboard Parameter in the Data Source SQL Query
- Switch to code view mode
- Add a query and type
@
to select the created dashboard parameter - Select the parameter with
IgnoreQuotes
option as shown below.
- Execute the query and save the data source.
Step 3: Bind the Values and View the Dashboard
- You can bind the dashboard parameter value in
Combobox
widget. - Preview/ View the dashboard.
- Change the parameter value, the query will automatically update to select the corresponding table. Refer the below gif image.
Make sure the table has same schema to avoid issues in dashboard.
By following these steps, you can easily switch between different tables in your data source SQL query using dashboard parameters in BoldBI.