Articles in this section

How to Apply Query‑Based OR Logic Using a Single Combo Box in Bold BI

Published:

In Bold BI, you can apply true OR logic at the query level to filter multiple fields using a single Combo Box. This approach uses dashboard parameters and Code View, allowing the database to return records where any one of the specified fields matches the selected value.
This method is recommended for large datasets and performance‑critical dashboards.

When to Use Query‑Based OR Logic
  • Use this approach when:
  • You want filtering to occur at the data source level
  • Dataset size is large
  • You need precise and reliable OR evaluation
  • You have access to Code View

Step‑by‑Step: Query‑Based OR Logic

Step 1: Create a Dashboard Parameter
  • Open the datasource in Edit mode and navigate to Parameters.
    image.png

    image.png
  • Create a new parameter based on the data you have:
    Example:
    Name: CriticalityParam
    Type: String
    Default Value (optional): High
    image.png
Step 2: Switch the Data Source to Code View
  • In the data designer page, switch to Code View.
    image.png
Step 3: Apply OR Logic in the Query

Replace your current query with the parameterized OR condition version.

image.png

Sample SELECT query:

SELECT
   RecordID,
   ProjectName,
   ProcessCriticality,
   PlanCriticality,
   Owner
FROM dbo.CriticalitySample
WHERE
   ProcessCriticality IN (@{{:CriticalityParam}})
   OR
   PlanCriticality IN (@{{:CriticalityParam}}); 
  • Click Run to execute the query and validate the parameterized logic.
    image.png

    image.png
  • Review the Data Preview to confirm that records are returned correctly.
  • Click Update, then Save the data source.
    image.png
Step 4: Bind the Parameter to a Combo Box
  • Add a Combo Box widget to the dashboard or modify an existing one.
  • Bind it to the parameter CriticalityParam.
  • Configure the available values (High, Medium, Low).
    image.png

    Result
  • When a value is selected in the Combo Box:
    • Bold BI passes the value to the query
    • The database returns records where either column matches
    • Widgets display the filtered dataset
      image.png

Conclusion

  • Using dashboard parameters with Code View allows you to implement true OR logic at the query level in Bold BI. This ensures filtering is handled by the database, delivering accurate results and better performance for large or complex datasets.
  • By binding a Combo Box to the query parameter, users can easily control multi‑field filtering through a single selection, making dashboards both efficient and easy to use.

Related Articles

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
EO
Written by Erick Oloo Awino
Updated:
Comments (0)
Access denied
Access denied