This not going to be pretty, but maybe it can give ideas.
I created two calculated fields:
IF (condition met) THEN [Dimension] END
IF (condition not met) THEN [Dimension] END
In the example attached I used:
IF LEN([Sub-Category])<7 THEN [Sub-Category] END
IF LEN([Sub-Category])>=7 THEN [Sub-Category] END
To simulate a legend, I placed the dimension the rows shelf
with a square mark. Then I placed both pfont1] and [font2]
on the text shelf an (suboptimally) shifted the alignment.
For the table headers, I used the crosstab method
(option 5 in this link: https://kb.tableau.com/articles/howto/color-a-single-column-in-a-crosstab-view )
Please see workbook v10.3 attached in the Forum Thread:
286193font.twbx 1.2 MB
1 of 1 people found this helpful
Firstly thank you - I agree it is not pretty, but it looks like it works, and once I get it working properly, it will be far better than the best alternative I had come up with (which involved creating a legend with some blank items for those I want in the second font, and then creating a .png object to which I add the blank items and then loading that as an image every time I use this particular field). I hated that option, as if anything changes in the data, the legend will not be consistent with the data!
I have been able to re-create everything in what you have described except what I suspect is the last, but key step.
That is how do you actually format the two Font fields. I thought it would be as simple as right clicking on the field in the text mark and doing the following:
- change the text for font1 from the default text to the Egyptian font
- for both, changing the alignment, so that the text is left aligned rather than right aligned (you didn't do this, but it would improve it to be more like a typical legend)
- I also removed the row lines above and below the legend which again makes it look more like a typical legend)
However I have clicked on the fields multiple times, and changed the text / alignment in every single combination of row / column / pane etc that I can think of and cannot find a way to change them. I also look at your example, and the text for both fields is the same throughout.
Where did you actually format the text for font1 in your workbook?
Once I get that to work, I think it will be a fantastic solution!
Aligning the text left like a legend takes a few more steps.
Because it is a label on a mark, it can only aligned left/center/right.
To get the labels on right but aligned left, I added some space padding
which is a function of the font type:
IF LEN([Sub-Category])<7 THEN
286193font2.twbx 1.2 MB
I just wanted to say thank you very much
I now have it working - at present with out fixing the alignment, as when I did it, the alignment looked a little funny due to my very unusual font rather than your space padding idea. I will continue to play with it to see if I can fix that, but to be honest even without it, it is fantastic and will more than meet my needs.
As always people in this community are really helpful, and I appreciate all your time on this
I'm glad it was helpful.
You have some very cool and unique dashboards.
All the best.
1 of 1 people found this helpful
Sorry, you may have corrected this already,
but just wanted to clarify in any case anyone comes across this:
the space padding should be
Yes I had got there, and had fixed the space padding in my version so it now looks great.