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
- Navigate to the Dashboard Parameters section.
- Create a new LIST parameter using the Custom Query option.
- 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.
- Run the custom query and update the parameter. This query will be executed whenever triggered within the dashboard.
Step 2: Use the Parameter in an Expression
- Create a new expression.
- Use the created parameter (e.g.,
parameter1
) in the expression and save it.
Step 3: Configure the Expression in Widgets
- Add the expression to the widgets in your dashboard.
- Configure the widget settings to achieve the expected result.
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: