Limiting the Number of Rows Displayed in a Pivot Widget
Summary: mbhg8c provides a solution for displaying a limited number of rows in a Pivot widget on a dashboard while keeping the query's LIMIT set high for export purposes. By using the transformPivot function, users can suppress rows beyond a defined threshold. The JavaScript snippet shared includes a threshold for visible rows and an optional pagination block to hide unnecessary pagination controls. Further details can be found in the Sisense Developer documentation.
If your Pivot Query LIMIT is set high to meet exporting requirements but you only need a few rows displayed in a specific Pivot widget on the dashboard, you can use transformPivot to suppress rows beyond a defined threshold. The screenshot below depicts the result.

To do so open the widget in Edit mode, go to the Edit Script tab, and paste:
widget.transformPivot(
{ type: ['member', 'value', 'subtotal', 'grandtotal'] },
(metadata, cell) => {
const threshold = 8; // maxDataRows (5) + headerRows (1) - 1
if (metadata.rowIndex > threshold) {
cell.content = '';
cell.style = Object.assign(cell.style || {}, {
color: 'transparent', backgroundColor: 'transparent',
borderWidth: 0, padding: 0, fontSize: 0,
lineHeight: 0, display: 'none'
});
}
}
);
widget.on("ready", (w) => {
const styleId = `hide-pg-${w.oid}`;
if (document.getElementById(styleId)) return;
document.head.insertAdjacentHTML('beforeend', `
<style id="${styleId}">
[widgetid="${w.oid}"] [class*="pagination"],
[widgetid="${w.oid}"] [class*="Pagination"],
[widgetid="${w.oid}"] .pivot-footer { display: none !important; }
</style>
`);
});Use the property threshold to control how many rows are visible.
The pagination block is optional — remove it if users still need to page through the full dataset.
For full transformPivot API details, see the Sisense Developer documentation.
The script was valided on version 2026.2.2.
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.