Knowledge Base Article

Blanking out grand totals and subtotals for specific columns in Sisense pivot tables [Windows]

Sisense Pivot Tables display grand totals and subtotals for all columns by default, which may not always be desirable. Sometimes, users want to show totals only for selected columns—such as displaying grand totals and subtotals for one column, while leaving others blank or visually hiding their totals. In this article, we’ll describe a method to hide the totals for specific columns on Windows using a combination of a plugin and a script.

Step-by-Step Guide: 

1. Install the following plugin: Grand/Subtotals for Specific Values in Pivot Widget Plugin

This plugin lets you control which columns display grand totals and subtotals. However, in some setups, the totals for excluded columns appear as 0 instead of being hidden.

To fix that, we’ll add a script that visually blanks out those zeros.

2. In your widget’s script editor, add this code directly below the plugin activation line:

prism.registerControlSubGrandTotal(widget); //line to activate the plugin from step 1

var columns = [3, 4]; // Specify date columns (zero-based index)
widget.on('ready', function (se, ev) {
  $.each(columns, function (index, value) {
    var num = $("tbody tr:first", element).children().length - value;
    $("tbody tr:has(.p-total-row-val)", element).each(function () {
      var cell = $(this).children().last();
      for (var a = 0; a < num; a++) {
        cell = cell.prev();
      }
      var numericValue = Number(cell.text());
      // Only blank zeros in totals
      if (numericValue === 0) {
        $(cell).css("color", "white");
      }
    });
  });
});

How to Add the Script

  1. Open your Pivot widget.
  2. Click Edit (pencil icon).
  3. Click the three dots in the top-right corner → Edit Script.
  4. Paste the code below the plugin activation line.
  5. Click Save.

What This Script Does

This snippet turns 0 values white, effectively hiding them in totals/subtotals.

Just update:

var columns = [3, 4];

…with the zero-based indexes of the columns whose totals you want to hide.

References/Related Content 

Grand/Subtotals For Specific Values In Pivot Widget: https://community.sisense.com/kb/add-ons_and_plug-ins/grandsubtotals-for-specific-values-in-pivot-widget/9131

Change the background color of the Pivot cell on value Windows:

https://community.sisense.com/kb/widget_and_dashboard_scripts/change-the-background-color-of-the-pivot-cell-on-value-windows/24819 

Note: Verified on W20.24.9

Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.

Published 11-28-2025
No CommentsBe the first to comment