What is the logic behind coloring or highlighting states? Most everything in Tableau is created starting with data, but you could create a color legend using a calculated field like:
IF [State]="Arizona" or [State]="Alabama" or [State]="Arkansas" or [State]="Alaska" then "A states"
Does that help at all?
They would like to indicate if certain states passed, failed, or is pending certain changes but this decision is driven by data not stored in the excel file. It’s just something they discuss or receive via other methods.
For example, they would like to highlight Texas, Oregon and Ohio one color and denote that color as passed. Montana and Georgia a different color and denote as failed. They’d end up with four different colors based on their request.
Would you still suggest writing an if-else-then statement?
I believe it would work for your purposes--there are likely several variations on how you could write the calculation.
Obviously, these groupings would be static and would need to be edited manually.
Lee, one central question is: do your clients want to select states on the Tableau map and have them colored according to their status, is it OK for them to record this information somewhere and have the Tableau map reflect it, something else, or are they open to any option that works?
It would be trivial to set up an excel sheet with two columns, one for the state, one for a pulldown (or other input for the status), and even disguise it so it doesn't really look like an excel file.
It would be simple to create a small app that would let the user tap on each state and assign the status. This app would then populate the data source Tableau would use to color it's map's states.
I don't see how selecting states in a Tableau map could be wired to changing their status, and therefore color, but perhaps someone will come up with a method.
I don't see anything in the original post about selecting states in order to transform data. Lee, please clarify if I've missed something.
If the question remains: "Is it possible to create a color legend manually?" then the answer is "Yes"
You can also use for example quick filters to highlight some of your states with different color and still keep them all there
1 of 1 people found this helpful
One other way of coloring a map independent of data is by dragging your State field and dropping it on "Color" on the "Marks" shelf.
First, Drag - Drop State field on "Detail" on Marks Card
Second, Drag - Drop State field on "Color" on Marks Card
Hope it helps!
I'm not sure what you are describing is "independent of the data"--using the State field on the color shelf means you are dependent on the States stored in your data source.
@Matthew - Yes, they want the static groupings and the ability to create a manual legend based on those groupings. I'm not completely sure I understand how to complete the if-then statement and color the states accordingly. Can you provide more detail?
@Chris - If I understand your question correctly, they would like to populate a map based on data from an Excel sheet. Following, they would like to manually highlight groups of states with different colors with information totally unrelated to data in the Excel sheet. This function would be similar to the 'Fill Color" option in Excel. Click on the state and select a color.
However, I am all ears if there is another way to acheive this.
@Aman - It seems your solution only colors points on the states rather than the entire state. They would prefer the entire state be colored.
1 of 1 people found this helpful
Aman's technique will color the states, when using a Filled Map in Tableau.
As I said before, you can write calculations like:
IF [State]="Arizona" or [State]="Alabama" then "States that start with A"
elseif [State]="Indiana" or [State] = "Idaho" then "States that start with I"
else "No group"
And use this calculation on the Color shelf, to create whatever coloring options you want (again, via Filled Map) You could also allow users to choose from various coloring options via a parameter, but that would be a bit more work to set up.
All, thanks for the feedback!
No problem--you can use grouping in Tableau as well, but it will be static (as will the calculated field option I provided).
If you've found a solution, please mark the question "answered" in some way so others know you've found a resolution.