top of page
Search
Writer's pictureJared Flores

What's all the fuss about Tableau Map Layers?




Let's talk about the map layers capability released in Tableau 2020.4, but before we get to that, you should definitely check out these amazing resources from some Tableau Zen Masters on the topic:






Also for the dendrogram with bars, this was thanks to Toan Hoang/Tableau Magic, which you can check out here


Tableau 2020.4 brought us the ability to apply unlimited map layers to a single sheet. While I could go into some detail on this, I believe the Zen Masters referenced above have done a fantastic job explaining this feature and you should definitely check out each article.


My goal in writing this post is to shed some light on some things I learned while experimenting with map layers. While this opens a door to some really exciting possibilities, it's also very very easy to over complicate how you're putting a dashboard together. So let's get into it.


As soon as I saw what was possible with this feature I got really excited. Being able to go further than using a dual axis chart is something I've hoped would be possible for a while now. The first thing I did was reverse engineer and recreate Adam and Luke's examples to try and understand what was going on behind the scenes. This led to an attempt to combine the two methods and this was the result.



And it's all on one sheet! While this doesn't seem like a big deal, I've been working on an executive dashboard at my job, and we've been looking for a way to make KPIs that stand out. There's a bunch of different options out there but a lot of the more aesthetic designs require at least 2 layered sheets on a dashboard. This one for example would've required a sheet with the dual area/line chart, and another sheet with the circle behind it. But even then, though you can add dots to each point on a line, you can't customize the design beyond that. With map layers, we're able to add some detailed design such as the outline around each of the dots (The dots are two separate circle Marks layered on top of each other. Luke outlines how to do this in his post). Now as we see from Adam's example, which you can check out here, we can expand on this and do even more on one sheet. So this is what I ended up with



Again, This is all inside one worksheet and it barely scratches the surface of what's possible in Tableau. Check out some amazing work from Soyoung Park who created a radial column chart using Map Layers here


Understanding Maps in Tableau

In order to take full advantage of this capability, you have to understand how maps work in Tableau. A map viz is just a set of points plotted on along two axis with an image of a map as the background, with Latitude being our Y value (Rows) and Longitude being our X value (Columns). The MAKEPOINT function is going to be your best friend in order to take full advantage of the map layers.


Even though you can place things wherever you want on the map using the function, it's important to take some time to plan out the mark types you’ll be using and what your final vision is.


If you're going to create a graph within the map, you have to normalize the values since the longitude values have to be between -180 to 180 and the latitude values have to be between -90 to 90.


Superstore KPI Dashboard


So for my dashboard, I wanted to be able to change the year while maintaining a comparison point between current year and previous year. I created a string parameter called Year with values of 2018, 2019, and 2020. I used this parameter in my equations so for Cost for example, I used these calculations

Current Year Cost

{FIXED MONTH([Order Date]) : 
  SUM(
    IF YEAR([Order Date]) = INT([Year])
    THEN [Cost]
    END
  )
}

Current Year Cost Normalized

([Current Year Cost]
/
{MAX([Current Year Cost])})/2

The reason I divided the normalized equation by 2 is because I needed to shorten the scale of the values in order to fit them inside the circle without going over the label. Depending on how you're placing things, you may not need to divide your normalized equation.


This process was repeated for the previous year values


Previous Year Cost

{FIXED MONTH([Order Date]) : 
  SUM(
    IF YEAR([Order Date]) = INT([Year]) - 1
    THEN [Cost]
    END
  )
}

Previous Year Cost Normalized

([Previous Year Cost]
/
{MAX([Current Year Cost])})/2

I normalized the Previous Year Cost using the current year cost in order to make sure they're on the same scale.


Since I wanted to utilize the Area mark type, I had to lay out all of the KPI cards horizontally. This is because the Area graph will always start at 0 on the X axis. This is the same when using the Bar mark type so be sure to keep that in mind when using those.


When mapping things out, in order to get rid of the map image:

  1. Maps > Map Layers in the tool bar

  2. Set the Washout to 100%

  3. Uncheck all the boxes


Also click on Map Options and make sure everything is unchecked




If you're going to be placing a few elements on the map, I recommend placing things around first before trying to get precise on the details. This is what my map actually looks like when working with them within the sheet




If you plan on placing your map within a dashboard, keep in mind that the way you size it within the dashboard will affect what it actually ends up looking like. This can make the process incredibly painstaking, and this is where you can fall into a trap of overcomplicating things. As I said earlier, this post is more about lessons I learned throughout this but if you're interested in a fully detailed blog post on a step-by-step for this or the Eye of the Superstore(m) dashboard, let me know! Before we get into that though, here's the Superstore KPI Dashboard for you to check out, download, and take a look behind the scenes.





The Eye of the Superstore(m)



This is where I fell into the trap of overcomplicating something and spending way more time than it really should've taken. With this one, I wanted to experiment with the Multi-Level Dendrograms and I thought it would be really cool if when you clicked on the main category, the KPI card shifted places. I wanted to parameterize the entire KPI card to get this done, and I wanted all the KPI cards to be mapped out on one sheet.


I ultimately abandoned this method and went with having each of the main KPIs one their own sheet and each of the Category KPIs had their own sheet. This is because In order to click the category on the dendrogram, It had to float in front of the map, and I really wanted the circles have that look of being propped up by the dendrogram so it just didn't work out as I'd hoped. But I spent HOURS mapping it all out before I got to that point and realized I had to start over. I knew that it was going to be more time consuming going into it this way, but I really wanted to explore the map layers some more.


I ultimately ended up using parameter actions to change the category, which in turn changed the placement of the points being plotted for each category to get them to move how I wanted. Check this out in action here


Here's what I learned through out this process: Map layers are exciting, they're groundbreaking, they're one of the best enhancements to Tableau. I can't wait to see what new visuals people come up with, and many people are already doing some really really cool stuff. Even though they're fun to play with, when using them to execute a design, it's ok to use separate sheets if it's simpler and more efficient. I got trapped in the mindset that it had to be on one sheet since it was possible, when I was unnecessarily making it harder for myself. You can still use the layers to create a unique design and duplicate it across different sheets if that's easier.


It can really get the creativity flowing to try and make a dashboard in one sheet though. My first submission to #ProjectHealthViz was done in one sheet. It's definitely much more minimal than some of the cool stuff being submitted, but it was just a self challenge to try and build a C-level dashboard using only map layers. This was the result




If there's any of these you'd like more details on, let me know and I'll work up a step-by-step guide!


1,081 views0 comments

Recent Posts

See All

Comments


bottom of page