Hi Dojo,
I have a table in a dashboard of a low-code app. This table has several rows that notify me when there is a problem in the schedule of the different channels. One of the columns tells me the type of program (commercial, promo, news, movie...). I was asked to add a filter to this column and I used the "search input" field as a feed. Instead, I would like to use a dropdown that would return only the requested types. I tried a query, but it returns all the rows. Is there a way to aggregate all the same type? Or should I use a different strategy to use the dropdown?
Thanks.
There are several ways to achieve this, and the best approach depends on your specific use case:
Table Variable in a Dropdown
Create a fixed table which contains the different programm types. Add the table to a dropdown and link the dropdown to the query, just like you did with the search box.
- Pro: Most performant since it avoids round trips to the backend.
- Con: Data is static, meaning it won’t update dynamically based on changes in the dataset.
- Best for: Predefined filter values that don’t need to change.
Add a query filter visualization and drop your channels query on it. Add the programmType column as filter, enable filter assistance and link its queries to your table.
- Pro: Easy to set up.
- Con: Requires backend round trips and may take up extra space in the UI.
- Best for: Simple filtering scenarios where space isn't a major concern.
Distinct Values from a Query in a Dropdown
Create a new query that starts from your channels query. Get the distinct values through built-in operators (aggregate channelColumn > distinct count > group by programmTypeColumn) or through a custom operator from the catalog.
- Pro: Keeps filter values in sync with the data.
- Con: Requires a query, making it less performant than a table variable.
- Best for: Cases where filter values need to reflect real-time data.
Each method has its trade-offs, so the best choice depends on your performance needs and data requirements.
Thank you Gilles. This is exactly what I was looking for.