This question came from one of our clients: Several of our clients would like to see conditional color coding and we can't figure out how to make it work consistently. For example, in Excel we have two columns, one for 2015 and one for 2016. We'd like to color code the 2016 column to show whether the value is more or less than the 2015 value. Is there any way to do this?
That's a great question and is a problem we run into a lot too. You only have two options (three if you count the up/down characters you can put into the Custom Format field).
Tableau assigns colors to each Continuous measure in your visualization - if you use Measure Values, that only counts as one. So you can either color the entire row, or you can create separate worksheets for the colored and non-colored marks and put them on a dashboard together.
Notes:
1) if you have to scroll through your viz, there's no way to synchronize multiple worksheets.
2) If you are using only 1 color (for example red to indicate lower performance), you can use black as your other color which makes it look normal.
1) if you have to scroll through your viz, there's no way to synchronize multiple worksheets.
2) If you are using only 1 color (for example red to indicate lower performance), you can use black as your other color which makes it look normal.
I also want to use this color coding system: Green= At or above goal, Yellow = 2% under goal or less, Red= 2%+ under goal. I'm trying to set up custom colors (see attached), but it never lets me get specific enough.
To do the custom color coding, create a calculated field with IF statements that compares the actual value to the criteria (E.g.
IF [value] >= [goal] THEN 'Green'
ELSEIF [value] >=.98*[goal] THEN 'Yellow'
ELSE 'Red'
END
ELSEIF [value] >=.98*[goal] THEN 'Yellow'
ELSE 'Red'
END
Then assign the appropriate colors to each value.
Now I need help creating the formula to show the difference between two columns. Is there any way to do "2016 values - 2015 values" or something like that? I would make an If/Then calc for 2015 and 2016 and then make a separate calculated field to find the difference, but once I add the 2016 filter it won't work, right?
The best way I've found to do the YoY calculations is using a calculated field called "Relative Year". It's just the difference between the current date and the report date. E.g. DATEDIFF('year', [report date], TODAY()) You should get 0 for the current year, -1 for 1 year back, -2 for 2 years back etc. Then you can make calculated fields for current year, 1 year back, and change this year over last year. It's all dynamic and doesn't require any filters outside the calculated fields.
Nice post ,keep update at
ReplyDeleteTableau Online Training