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
- Open your Pivot widget.
- Click Edit (pencil icon).
- Click the three dots in the top-right corner → Edit Script.
- Paste the code below the plugin activation line.
- 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.
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.