Hide Empty Pivot Table

Does anybody know how to hide an empty pivot table? I don't want it to show in a report as "No data" - just want to hide that pivot table if there are no results.

 

Thanks

Don't worry - I think I managed to get it right:

 

$(document).on('knack-view-render.report', function (event, view, data) {
$("div:contains('No data')" ).parents('.kn-view').hide();
});