Drill up & down a hierarchy in a table using buttons

An alternative way to allow users to drill up down hierarchies in a table (or chart)

drill

Script to drill down

// get the dimension in the first row
var dimension =Table_6.getDimensionsOnRows()[0];   
// get the current hierarchy level of the dimension
var drill =Table_6.getDataSource().getHierarchyLevel(dimension); 
// set the hierarchy level to the current hierarchy +1 level – so drilling down
Table_6.getDataSource().setHierarchyLevel(dimension,drill+1);
Code language: JavaScript (javascript)

Script to drill up

// get the dimension in the first row
var dimension =Table_6.getDimensionsOnRows()[0];   
// get the current hierarchy level of the dimension
var drill =Table_6.getDataSource().getHierarchyLevel(dimension); 
// set the hierarchy level to the current hierarchy +1 level – so drilling up
Table_6.getDataSource().setHierarchyLevel(dimension,drill-1);
Code language: JavaScript (javascript)
Scroll to Top