-
1. Re: Dynamically Adjust Colours for Filter
Simon RuncMar 12, 2018 7:07 AM (in response to Stephanie Greis)
hi Stephanie,
One thing that might work here would be to create an index() calculation off the level you want to colour, and then use the Index as the colour.
Take a look at the attached (where I've created a separate sheet to act as the legend), and see if that might do the trick.
Hopefully you can see how I've done it, but let me know if anything doesn't make sense.
-
Dynamic Colouring on Selection.twbx 1,008.1 KB
-
-
2. Re: Dynamically Adjust Colours for Filter
Stephanie Greis Mar 13, 2018 5:49 AM (in response to Simon Runc)Thank you, Simon!
I'm afraid the workbook doesn't seem to be downloading correctly. Could you possibly upload another version?
I'm using version 10.2.0.Thanks a lot!
-
3. Re: Dynamically Adjust Colours for Filter
Simon RuncMar 14, 2018 2:16 AM (in response to Stephanie Greis)
Not a problem (thanks to Tableau 10.5's new Save as previous version feature )
-
Dynamic Colouring on Selection_v10.2.twbx 1,008.3 KB
-
-
4. Re: Dynamically Adjust Colours for Filter
patrick.durach Mar 14, 2018 5:27 AM (in response to Simon Runc)Hi Simon,
Stephanie and I are collaborating on this Tableau Project.
Thank you very much for your detailed help. The dynamical adjustment of the colors is working now.
However, another problem occurred:
Whenever I filter the Data the sorting order changes.
Is there a way to include a sorting order (Highest Number of Accounts to lowest Number of Accounts) which affects also the Legend Sheet? This Sorting order should be based on the filtered view. (e.g. sorting on index())
Thanks a lot for your help!
-
5. Re: Dynamically Adjust Colours for Filter
Simon RuncMar 14, 2018 5:42 AM (in response to patrick.durach)
hi Patrick,
The Index() calculation just numbers things in order, so in my example as there was no sort everything was alphabetic and so remained consistent between the 2 sheets (as the City filter is shared). We can do this equally, but sorting the category on something
In the attached sorted the Category in both sheets on Sales, and they now retain the colour on the sort
Hope that helps.
-
6. Re: Dynamically Adjust Colours for Filter
patrick.durach Mar 14, 2018 7:39 AM (in response to Simon Runc)Hi Simon,
thanks a lot for the quick response.
I already tried it this way. In my Case the field is Bank Accounts and the Aggregation is Count.
However it is not sorted correctly.
Is there a way to sort based on Index()? E.g. the highest Index on top - lowest on bottom?
-
7. Re: Dynamically Adjust Colours for Filter
Simon RuncMar 15, 2018 1:53 AM (in response to patrick.durach)
hi Patrick,
So yes you can create a sort within an index()
However if I want something sorted, I generally opt for the RANK functions....which have (of course) sort built in. For this situation you'll want RANK_UNIQUE (else if 2 Bank Accounts have the same count, they'll get the same RANK and thus colour)