3 Replies Latest reply on May 22, 2013 7:05 AM by Brad Llewellyn

# Tableau 7 - How can you colour NULL values on a grid with diverging colour values?

I have a data grid with colours based on a % value. In some instances I have some NULL values where there would be a DIV/0 error. I would like to highlight these by changing the colour of the cell to grey.

Example:

12
A£10£20
B£92£50
C£56

£76

e.g. I want to be able to colour cell B,1 grey for instance as the metric % is NULL. The label is Metric 1 and the colour is Metric 2 (the %).

Does anyone know how to do this? I am probably overlooking something very simple!

Thanks guys!

Jake

• ###### 1. Re: Tableau 7 - How can you colour NULL values on a grid with diverging colour values?

Jake,

If you use the ZN() function, you should be able to achieve this.  For example,

ZN( 1 / 0 ) would return 0 instead of #N/A

Your diverging color palette should handle the rest.

Hope this helps,

Associate Consultant

Mariner, LLC

http://breaking-bi.blogspot.com

• ###### 2. Re: Tableau 7 - How can you colour NULL values on a grid with diverging colour values?

Thanks for the reply. Sorry I should have mentioned that 0% needs to show as green. A NULL needs to be grey and anything above 100% needs to show red. So in this case, '0' and NULL are both valid pieces of information that need to be shown separately... if you know what I mean.

• ###### 3. Re: Tableau 7 - How can you colour NULL values on a grid with diverging colour values?

Jake,

You're probably better off creating a discrete measure based off of Metric 2.  For example,

IF ISNULL( [Metric 2] ) THEN "Grey"

ELSEIF [Metric 2] > 1 THEN "Red

ELSE "Green"
END

Then defining a categorical color pallete.  You could separate this into more combinations between "Green" and "Red" if you wanted to, but that's gets into creating a custom color pallete.  If that's the route you want to go, take a look at http://kb.tableausoftware.com/articles/knowledgebase/creating-custom-color-palettes

Hope this helps,