2 Replies Latest reply on Mar 4, 2013 8:31 PM by Chris Moseley

    default color and shapes for a variable value

    Chris Moseley

      I'm building a tool to help with analysis of competitors.  As part of this effort, I allow users to identify a specific competitor location ("Selected Location") to explore in detail.  They do this by picking it from a Parameter list populated with all locations in the market.


      One piece in the anlysis is a map with "My Location", the "Selected Location" and then all other players in our space.   I built this up using a CASE statement calculation in the color pill so that "My location" on the map is always Orange, "Other Locations" are always Blue and the "Selected Location" is a third color. 


      And that's where my problem begins. The default color Tableau applies to the "Selected Location" is unacceptable; it is barely distinguishable from the background map.  I keep changing the default color for individual locations, which works fine (they stay the correct color when revisited at a later date) but only for that specific location.  When the user selects a new location to view, it appears in crappy tableau default color. 


      The prospect of manually changing the defaul for each of the 400+ locations is daunting.  Also, any time there is a new location or a name change, I will have to go back and change their default color.  I tried adjusting the field properties for my calculation but, again, it only changes default color for the currently-selected location and not the others locations selected in the future. 


      My question: Is there a way to dictate the default color (or shape) for the selected location even though the selected location is frequently changing?   


      Thanks for any assistance. 

        • 1. Re: default color and shapes for a variable value
          Tracy Rodgers

          Hi Chris,


          I'm guessing your calculation may look similar to the following calculation:


          (This calculation is called [My Location, Selected Other])

          if State=[My Location] then 'My Location'

          elseif State=[Selected Location] then 'Selected Location'

          else State



          Create a second calculation based off the above similar to the following and place it on the color shelf:


          if [My Location, Selected Other]='My Location' then 'My Location'

          elseif [My Location, Selected Other]='Selected Location' then 'Selected Location'

          else 'Other Location'



          Then, the other locations will always be the same color based on whatever color is chosen for Other Location.


          Hope this helps!



          • 2. Re: default color and shapes for a variable value
            Chris Moseley



            Very clever, my friend!  This is a simple, elegant solution that eluded me for days.  I really appreciate your help.  The only drawback I see to this approach is I lose the ability to have the actual name of the selected location appear in the legend (as opposed to the generic "Selected...") but I have the name prominently stated above the map so, little is lost and it's a small sacrifice well worth the improved user experience.


            Thanks again.