5 Replies Latest reply on Jan 19, 2015 2:19 AM by Sam Wright

    Losing map background in dual axis map

    Andy Peters

      Hello, all-


      I'm making a viz with a map that shows the relationship between two geographies (US PUMAS and CBSA's).  I've converted Census shapefiles for these geographies into polygons for Tableau.  What I'd like to do is to have just an outline of the CBSA in the background, then overlay the PUMAS on top, color coding by whether they are purely interior to the CBSA or whether they overlap the edge.  So I need a dual-axis map so I can control the colors of the CBSA's differently from the PUMAs. (Yes, I'm aware I could just turn on CBSA borders in the background map, but (1) I don't want to see all CBSA borders, just one particular one; and (2) I'm going to want to do this with geographies that Tableau doesn't know about eventually)


      All is well when I use a single axis ("Single Axis" worksheet in the attached workbook).  I can show the different geographies, and even get a sense of the overlap using transparency.  But I'm not happy with the aesthetic, so I'd like to do it as dual axis as described above.  But when I do this, the map background goes away; Tableau brings back the Cartesian grid and scaling x & y in non-maplike ways (see "Dual Axis" worksheet).


      How can I make this viz dual-axis but keep it a map?

        • 1. Re: Losing map background in dual axis map

          Hey Andy Peters,


          Admittedly I don't do too much intensive mapping in Tableau Desktop as my expertise is on the Tableau Server side of things. BUT, I remembered seeing this post on our Public Blog and thought maybe it would help.


          Going Dual Axis on Maps


          I might be way off but hopefully it helps!

          • 2. Re: Losing map background in dual axis map
            Andy Peters

            Thanks, Diego-


            I'd glanced at that post while looking for a solution.  It describes more-or-less what I've done; the problem is that when I add the second latitude measure the map context disappears:  for some reason the map background no longer appears, aspect ratios go wonky, etc.  So while the post was a good primer, it doesn't solve my problem.

            • 3. Re: Losing map background in dual axis map
              Andy Peters

              So I've figured out the reason for this phenomenon, though I'm still working on a good solution.


              I'd created two different calculated latitude measures based on the level of geography (PUMA vs CBSA); both returned Null for rows of the "wrong" geography type and the latitude for the "correct" type (e.g., [PUMA latitude] = null if geotype is "CBSA" and [Latitude] if geotype is "PUMA").  Then I dragged the two latitude measures to the Rows shelf.


              It was the two different latitude fields that was the problem.  Apparently only when you have two instances of the same measure does Tableau give you a map background.  If the measures are different (even if they're both defined as serving the Latitude geographic role) Tableau treats the viz as a general Cartesian grid rather than as a map.

              • 4. Re: Losing map background in dual axis map

                That's a bit out of my wheelhouse but let me know if you have any success resolving the issue. I'm sure others would be curious to know the result.

                • 5. Re: Losing map background in dual axis map
                  Sam Wright

                  Could you change the layout of the underlying data so you only had one latitude and one longitude column, and make a variable which tells you which level of geography it is PUMA or CBSA?


                  From here

                  Create your map as normal

                  Drag this new column into colour and right click on one of them (eg CBSA) and hide it from the map.

                  Right click on the latitude column to make a dual axis as you would normally

                  Duplicate your new column and drag the duplicate onto the colour of the new map.

                  Hide the other colour (PUMA), this should leave you with one map of CBSA and one map of PUMA then you can synchronize axes without losing the background map.


                  That's my normal technique for getting points on top of my custom made boundary maps.