Switching Measures in/out of a table using a dropdown list

* It is assumed that the dropdown list has already been populated with a list of measure objects

Widgets
Dropdown List: ddl2
Table:  tbl

Script placed in the dropdown onSelect event

var measure = this.getSelectedKey();
var TableFilter = ArrayUtils.create(Type.string);
TableFilter.push(measure);
tbl.getDataSource().removeDimensionFilter(Alias.MeasureDimension);
tbl.getDataSource().setDimensionFilter(Alias.MeasureDimension, TableFilter);
Code language: JavaScript (javascript)
Scroll to Top