Discrete and Continous coloring in Tableau.

This has long bothered me in certain circumstances.  If you have a null value in a continuous pill then Tableau will color that null as if it were a zero.  Under most circumstances this is an okay solution, and I have to credit the programmers; it is better than the alternative.  When in doubt, show something and show it predictably.

So here is the problem I have faced.  Lets say zero is good, 10 is bad, and NULL is indifferent. Tableau will display null as the same color as zero.  Now lets say zero is good, 10 is bad, and NULL is BAD.  Now lets say 10 is good, -10 is bad, and NULL is something else.  When you place data into Tableau it will color nulls as zero.

However, Tableau is awesome and I was able to find an easy solution:

FinishedProduct

The secret is not really hard.  Basically all you need is two calculated fields, and then place  a  “transparent” image in your custom icons.

Formula 1
Float:  FLOAT([Type1])

This will take a number and convert it into a float, if there is a NULL or text it will make them all NULL.

Formula 2&3
NullFill_1: case [float]  when null then ‘NULL’
else ‘FILL’
end

Now just duplicate NullFill_1 as NullFill_2.

Formula 4:
1:1

This “1″ is solely just a place holder, call it anything and set it to 1.   Now take “1″ and place it on the column shelf twice.  Place Nullfill_1 on one shelf and NullFill_2 on another shelf and make 1 transparent, and give another a real shape.  If you need a transparent icon, just use this one:

NA blank trans

Now your Tableau workbook should look like this:

DualAxisThis

Now just dual axis those, adjust some of the legends and you will get this awesomeness!

 

Posted in Uncategorized | Leave a comment