Replace Null values or N/A's with zeros in Pivot Grid
In Widget editor/Edit Script option, place script (below), click save, and refresh widget page.
To replace N/A values:
widget.on('ready', function(){
$('td[class*=p-value] div').map(function(i, cell) {
if(cell.innerHTML == "N\\A" ) cell.innerHTML=0;
})
})
Or to replace null values:
widget.on('ready', function(){
$('td[class*=p-value] div').map(function(i, cell) {
if(cell.innerHTML == " " ) cell.innerHTML=0;
})
})
Before:
After:
-
I am in the exact same boat as Brian Wilson
I'm trying to show a 0 across more than one dimension table and I was using that method of adding the hardcoded 0 LeftJoin column.
-
I need to loop through all the columns in my Pivot and replace empty row cells with '$0.00' for the columns that don't have the text '% change' in the heading . I found the below script that can replace the text but struggling to loop through the columns and change value on a conditional basis. Anyone who can help?
widget.on('ready', function(){
$('td[class*=p-value] div').map(function(i, cell) {
if(cell.innerHTML == " " ) cell.innerHTML='$0.00';
})
}) -
It's not similar at all.
-
Okay, thanks Nathan Giusti.
I turned on the (new to me) feature continuous timeline to get it to work.
-
Yeah, that functionality has been set up for some widgets but not others so you lucked out. The added feature is very new. Pivot users will still have problems.
-
I'm using a simple table widget in 8.2.1.10097 and none of the mentioned methods work.
I need to replace the "N\A" (which is NULL in data source) with an empty cell and highlight that cell with red (or whatever color).
Is that possible? Seems to be missing a very basic functionality...
Please sign in to leave a comment.
Comments
40 comments