This script is useful for capturing the measure value clicked by an end user in a table.
I typically use this logic to capture a value and pass it as a filter elsewhere.
The Script below is placed in the ‘onSelect’ event of a table
var sel = this.getSelections()[0];
var value = this.getDataSource().getData(sel).formattedValue;
Code language: JavaScript (javascript)
Extra line of code to write the value to a text box
var sel = this.getSelections()[0];
var value = this.getDataSource().getData(sel).formattedValue;
txt_box.applyText(value);
Code language: JavaScript (javascript)
