Basic Dropdown onSelect code to filter a table by a selected dimension member or All values (no filter)

In this code example you would have a dropdown list and a table.
You want to filter the table ‘Sales Manager’ dimension using the dropdown list

var key= this.getSelectedKey();
Table_1.getDataSource().removeDimensionFilter("Sales_Manager");
if(key!=="All") // If the selected value is not equal to ‘All’ then apply the dimension member filter
	{Table_1.getDataSource().setDimensionFilter("Sales_Manager",key);}
Code language: JavaScript (javascript)
Scroll to Top