sandeep pradhan
sandeep pradhan

Reputation: 271

How to put color for the whole cell

I am trying to color code my list in tableau with red color for dates in end date lesser than today() or when concern column is Yes. I created a dual axis of 1 and 0 to get the cells with color in one column and get the text in another and created a dual axis so that they overlap. For that I created a calculated column where I gave the color red if the conditions meet.

This is in my calculated field:

Color:

IF TODAY()>[End Date]  OR [Concern (Yes/No)]="Yes" then "RED"
ELSE "None"
END 

However even after totally maximizing the size of the square for color for 1. The fields do not fill the whole cell. How do I fill the whole cell?

Here is the pic:

enter image description here

Please help me out here?

Upvotes: 0

Views: 424

Answers (1)

Andy TAR Sols
Andy TAR Sols

Reputation: 1735

You may have 2 options here. I haven't tested so will leave you to see what works best.

Option 1 - use a measure and a Square mark type. Create a calculated field that returns a measure. We can adapt the formula you have built:

INT(TODAY()>[End Date]  OR [Concern (Yes/No)]="Yes")

Put that field on Columns - aggregate to either MIN or MAX, doesn't matter - and set the Mark Type as Square. Also put this field on Colour and set your colours accordingly. Put your text on the Label shelf (or Text, I forget what it's called with the Square mark type.

Option 2 - similar to what you have now. You don't need MIN(1) and MIN(0), just one of those should suffice. Make it Gantt, the above calculated field on colours and your text field on Label. This article on the Tableau placeholder technique describes how to do this.

Upvotes: 1

Related Questions