Filter to show the first row in a table

1st row filter

The Script below could be placed in a button for example

var result = Table_2.getDataSource().getResultSet();   	       // get the result set of the table
var Dimension = Table_2.getDimensionsOnRows()[0];       // get the Dimension in the first row
for(var i=0; i<1; i++) 	// create a loop that runs only once
{ var cell = result[i]; 	// get the first result value
var Member=cell[Dimension].id; } 	// get the ID of the first result value (for the dimension in the first row)
Table_2.getDataSource().setDimensionFilter(Dimension,Member); 	// apply the filter
Code language: JavaScript (javascript)
Scroll to Top