Populate a dropdown list excluding specific dimensions from the data model

var dimensions = Table_1.getDataSource().getDimensions();
var target_dimensions =['Sales_Manager','Store','Product'];
for (var i=0;i<dimensions.length;i++)
         {     if (!target_dimensions.includes(dimensions[i].id))    
               /* just add  !  to the script as highlighted in red above 
                     this will exclude any dimensions specified in the variable ‘target_dimensions’  */                 
            {    Dropdown_1.addItem(dimensions[i].id,dimensions[i].description);    } }

Code language: JavaScript (javascript)
Scroll to Top