Category / Section
How to apply filter in Grid widget based on your list of keywords?
Published:
Please follow the steps below to apply the filter for any column based on multiple keywords,
- Create the table in your SQL server to store the list of keywords to be filtered,
- Create a custom function in the SQL server to determine if the value of a column contains any of the words found in a table of keywords.
If the @searchWord
contains any of the words in the Keyword table, it will return as ‘1’; otherwise, it will return as ‘0’.
NOTE: You can customize this logic according to your specific requirements.
- By using the custom function that has been created, you can create the expression shown below in our Dashboard Designer,
- Configure the created expression column in the widgets. The Expression column should be added to the Hidden Column section of the Grid widget.
- Apply the filter to the Expression column based on the values 0 and 1.
Here, 1 represents the column value that contains the filter words, and 0 represents the column value that does not contain the filter words.
Before applying a filter in the Grid widget,
After applying the filter in the Grid widget,
NOTE: In this approach, you do not need to modify the expression. You simply add the new word to your Keyword table alone.