Drill Down Customization

Hello Team Helical,

I have a tabular report in which a column has range of ages like 10-20, 20-30 etc. I want to drill down on this column. The child report should show only those entries whose ages fall within the category selected. For example, if I select 10-20, the child report should show only those entries that have age between 10 and 20.
Also, the parent report should pass on the values of the other columns in the row as parameters to the child report. The child report should appear in the same frame as the parent report.

Thank You
Kevin.

1 Like

Hello Kevin,

For achieving the drill down for the range, we will have two filters in the child report – Min Age and Max Age on the same age column. The values passed will be compared to these 2 ages.
Similarly, on the parent report, on click of the element, we will split it into 2 parts: min: the lower value and max: the higher value in the range.
We will append this to the URL as separate parameters to be passed.
We will read the other columns of the table using the row and column index and append to the URL.
For opening in same frame, we will mention _self.
You can use the following script in the JS Editor pane:

hi_container.set('postExecution', function(){
$( document ).ready(function() {
$('table tbody tr').on('click',function (e) {
e.preventDefault();
var rowdata = this;
var urlData=$(this).html();
var data=rowdata.childNodes;
var filter1=data[0].innerText;
var filter2= data[1].innerText;
var drillDownValue=filter2.split(/-/);
var startAge=drillDownValue[0];
var endAge=drillDownValue[1];
var columnIndex=e.toElement.cellIndex;

if(columnIndex==1){
window.open('http://localhost:9090/hi-ee/hi.html?dir=1588929857484&file=03bf8464-9cbd-4b41-a860-8bb633d18792.report&mode=dashboard&minAge='+startAge+'&maxAge='+endAge+'&Company='+filter1,'_self');
}
});
});
})

Thank you
Team Helical