Articles in this section
Category / Section

How to create Dynamic Filters to append values from a particular column

Published:

In some scenarios, you may need to create dynamic filters to perform some operation on the data as we receive it. For instance, say that you need to append all the values from a particular column with comma delimiter. This can be achieved using Dashboard Parameters with Custom Query mode. Follow the steps below to achieve this

Step 1: Create a Dashboard Parameter with Custom Query

  1. Navigate to the Dashboard Parameters section.
  2. Create a new LIST parameter using the Custom Query option.
  3. Use the following syntax to aggregate the desired field values separated by commas:
SELECT
STRING_AGG(<ColumnName> , ',') AS "Name_100"
FROM <schema>.<table> AS "tablename"

Note: Replace table, Column_Name, and schema with the appropriate values for your data source.

  1. Run the custom query and update the parameter. This query will be executed whenever triggered within the dashboard.

Dashboard Parameter with Custom Query

Step 2: Use the Parameter in an Expression

  1. Create a new expression.
  2. Use the created parameter (e.g., parameter1) in the expression and save it.

Expression with Parameter

Step 3: Configure the Expression in Widgets

  1. Add the expression to the widgets in your dashboard.
  2. Configure the widget settings to achieve the expected result.

Final Widget Configuration.PNG

By following these steps, you can create dynamic filters. You can now see the expression field Join Name_100 has all values appended from the Name_100 field. Whenever new data is seen in the Name field it will be automatically appended to the expression field.

Related Links:

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SG
Written by Sivabalan Ganesan
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied