Add this to your $$ViewTemplate for the categorized view. The first column should total and hide the details row.
$('.viewdiv table tr').each(function(){
var firsttd = $(this).find('td:first');
if (firsttd.html()=='<font color="#000000">1</font>'){
$(this).hide();
}
});
$('.viewdiv table tr:last').hide();
$('.viewdiv').removeClass('d-none');