cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member

Challenge: 

Rarely we would have to hide all the rows of pivot table and only show the Grand Total Rows. This will help us preserve the context provided by the dimension used in the rows of the pivot table but hide it to show the "Grand Total" only. 
 

Solution:

In the pivot table, modify the number of rows per page = 2, so we can shrink the pivot table as small as possible. Turn on the "Grand Totals" on the top most dimension added in the rows of the pivot table. 
Use the script editor of the pivot table widget and copy - paste the following code. Save the script and refresh the page. 
widget.on("ready", function(w, args){
 var rows=200;
 var i;
 for (i = 1; i < rows; i++) {
  if ( $("tbody tr:nth-child(1)", element).html() == $("tbody tr:last-child", element).html() ) { 
   break;
  }
  $("tbody tr:nth-child(1)", element).remove();
 }
 $("div.p-foot").remove(); 
});
You're all set! 
PS: Setting the rows per page = 2 will help your pivot table's performance! 
Rate this article:
Version history
Last update:
‎03-02-2023 09:13 AM
Updated by:
Contributors