Forum Discussion

dougnewton's avatar
01-17-2024

Turning zeroes to blanks/empty cell when Zero

Sometimes with a pivot table full of many columns with zero and only a few non-zero values, you want the zeroes to display as empty-string.  That way the nonzero values really stand out.

(This is the opposite of this:  Solved: nulls to 0 in pivot - Sisense Community )

Below is a widget-level script suggested by tech support which worked for me.

 

widget.transformPivot(
  {
    type: ['value']
  },
  function setCellBackground(metadata, cell) {
    if(cell.content.trim() == 0)
cell.content = ' '
  }
)

1 Reply

Replies have been turned off for this discussion
  • Thank you dougnewton! I have copied this over to a Knowledge Base article. I appreciate the great content!