I'm just looking through some unanswered questions and came across this one!...
In Tableau you can put 2 dimensions onto the colour shelf...if you drag the first one onto colour and then add the second one, you can then also change that to colour using the little selector next to the pill
You can then drag the colours in the Legend, so that you have them stacked in the order you want. The attached shows Sales, by Year coloured by both customer segment and category.
Hope this helps, but if not please post back and I'll be happy to take another look.
Colour on Multiple Dims.twbx 1.2 MB
This is an awesome way to change the colours on a chart to have more than just one breakdown reflected.
The legend is created by concatenating all the possible values in all the possible calculations that are found in the data.
However, if one of the values carries a null, it concatenates 'null' in the legend description. Is there a way to remove nulls from the legend description?
Here are a couple of options...
In the attached I've created a "New Segment" field, which contains a NULL for one combination.
One is to just filter out the NULLs
and the other is to build up the concatenated field in a calculation (although you then need to manually set the colours, as Tableau won't know to group them into "like" colours.
IFNULL([New Segment],'') + ', '+IFNULL([Category],'')
Hope that helps
Thanks, Simon. Yes, I tried using a calculated field, but there are a few fields I am concatenating and different ones are null under different circumstances. The query Tableau generates to the database is just awful and no doubt not helping my performance on a large dataset.
I can't see anything attached to your post, but the problem is not with an entirely null value that I can filter out, but by one or some of the elements in the concatenated files containing null, and it states 'null' as PART of the value of the field in the legend. It would be nice if it could just omit it automatically or upon request.
1 of 1 people found this helpful
Yes it would be nice to be able to have more control of what is shown in the legend. However I have a couple of further options
In the 'NULLs as Blanks' I use this calculated field to show NULLs as Blanks
[New Segment - NULLs as Blanks]
so the legend looks like this...
My final version, which I use quite a bit...is to create a separate sheet where I create the Legend showing what I want to show (using Filters). I then bring this onto a dashboard, and make the 'Create Legend in Separate Sheet' really small and use the legend from this sheet
Hopefully one of those might help
An interesting trick, Simon, but a bit cumbersome. It seems such an easy thing to be driven by the click of a button or selection of an option.
I think I will pursue making sure that the nulls are excluded from the descriptions.
Thanks for your input.