This code will take the clicked (selected) dimension member description from a table in much the same way as we did for measure values.
However – it’s only really suitable for a table containing 1 dimension,
the reason being if there were multiple dimensions we have no way of knowing which dimension member cell a user has clicked on.
Ergo in the script below the dimension ‘Product’ has been hardcoded.
The Script below is placed in the ‘onSelect’ event of a table
var sel = this.getSelections()[0];
var result = this.getDataSource().getResultMember("Product",sel).description;
Code language: JavaScript (javascript)
