Single Filter against multiple columns
Hello Experts
I wonder if there is way to build a single filter on Dashboard that interacts with 2 different columns in the database? Here is an example
2 columns in table:-
- primary City
- secondary city
On the dashboard level, we would like to build a single filter called 'city' which should filter against both of these columns using OR condition (eg: select sum(sales) from customer_orders where primary_city='Toronto' or secondary_city='Toronto'
Hi ramansingh89,
You can add each column as a dashboard filter, and then use the Filter Relationship feature to create the OR logic. To cascade the selection from one filter to the other and ensure the two filters are always synchronized, you can use the script in the Dashboard Script for Automatic Filter Cascading article. To declutter the UI and avoid confusion for the users, you can use the free and officially supported Hide Filters add-on by Paldi Solutions to hide the second filter.
This way, users will only see and interact with one filter, but it will automatically pass the selection to the hidden second filter as well in the backend.
Let me know if you have any follow-up questions.
-Tri