Dropdown with filtered data
The advanced dropdown is able to work with all loaded data of the app. Upon opening the dropdown the data is loaded as a list, that means that selections do not affect the resulting entries. Normal Qlik syntax can be used though, which makes all required outcomes possible.
In this example we will use the selected value of a different column as a filter.
Load * inline
[
Category, Vehicle
Personal, Bike
Personal, Car
Public, Bus
Public, Train
];
- Add two Dropdown (Advanced) columns
- The first dropdown will be the Category
(simply put in the field name, selections will not affect the data) - The second dropdown will be our filtered vehicle list
- Filtering that list is done with:
=aggr(only({<Category={'Public'}>}Vehicle),Vehicle)
(In this case we would get the list of vehicles belonging to the ‘Public’ category) - To get a more dynamic list, we could use functions like
GetFieldSelections()
or in our case make use of the Data+ variable replacement system.
Accessing the value of another column in the current row can be done with$([columnHeader])
([columnHeader] is the header label of the column) - We want the value of the column
Category
, therefore our script will look like this:
=aggr(only({<Category={'$(Category)'}>}Vehicle),Vehicle)
Last updated on