7 Replies Latest reply on Jun 22, 2016 1:12 AM by Steve Taylor

    How to create a two data category in 1 map view?

    John Philip Mariveles

      Hi,

      Just want to ask on how to create a two data category in 1 map view?

      for example: Office Locations vs Home Locations

      here are the metrics that we want to know.

      how many people that lived in city "A" that also works in city "A"

      how many people that lived in city "B" that works in city "A"

        • 1. Re: How to create a two data category in 1 map view?
          Steve Taylor

          Hello John

           

          Can I ask what your data looks like? For example, do you have a unique ID for a person, a home location and an office location? If so are those locations cities/towns that are already recognised by tableau's default geocoding (i.e. can you drop the city dimension into a worksheet and a map populates with dots for those cities)?

           

          If so you could look at plotting home - office locations as paths using a bit of data re-structuring as detailed in this article:

           

          Using the Path Shelf for From - To Pattern Analysis | Tableau Software

           

          And maybe use different coloured dots to show people whose office and home locations are the same to those who commute from a different location?

           

          Steve

          • 2. Re: How to create a two data category in 1 map view?
            John Philip Mariveles

            Hi Taylor,

            here's example of what my data loos like. see the attached file for more details. thanks!

             

            Big Blue = Office Location

            Small Blue = Home Location in Blue Office Location

             

            Big Red = Office Location

            Small Red = Home Location in Red Office Location

            • 3. Re: How to create a two data category in 1 map view?
              Steve Taylor

              Hello John

               

              I've attached a workbook that I think solves your question. There are a few things to note:

               

              Drop office city into the worksheet and set the geographic role to state:

               

              Screen Shot 2016-06-16 at 11.06.04.png

               

               

              To get two marks cards (so you can plot office locations and home locations in the same map) you just create a copy of the generated longitude (ctrl click the existing longitude and drag onto the columns shelf) then set to Dual Axis.

              Screen Shot 2016-06-16 at 11.04.42.png

               

              Set the colour of the first longitude mark card to office city and change to a shape (I've used open circle)

               

              then drag home city onto the level of detail for the second marks card and remove office city. At this point duplicate the Office City field and set geographic properties to none. you can then use that field as colour for the marks card showing the home city.

               

              Screen Shot 2016-06-16 at 11.11.43.png

               

              Hope that helps, let me know if you have any questions

               

              Steve

              • 4. Re: How to create a two data category in 1 map view?
                John Philip Mariveles

                Hello Steve,

                 

                Thanks for taking time on my query. Your answer in close to the view that I want to achieve. Our goal in our view is to know the employees home that far to heir Office location. If you noticed, the orange pin from your answer are only down to two compare from the raw file. Maybe you can help us more to get this kind of view. thanks in advance!

                • 5. Re: How to create a two data category in 1 map view?
                  Steve Taylor

                  Hi John,

                   

                  Sorry I don't understand what you're asking for, would you like to know the distance employees travel to the office? Or did you want a count of employees whose home location is not the same as their office location and a count of those where home location = office location?

                   

                  Steve

                  • 6. Re: How to create a two data category in 1 map view?
                    John Philip Mariveles

                    Hello Steve,

                     

                    Yes! employees whose home location is not the same as their office location and a count of those where home location = office location

                     

                    Thanks!

                     

                    Philip

                    • 7. Re: How to create a two data category in 1 map view?
                      Steve Taylor

                      Hi Philip,

                       

                      Really sorry I got this wrong, I missed that in some cases there were employees with the same home location but difference office locations and the marks on the map were stacked on top of each other so these couldn't be seen.

                       

                      If you have more detailed location information in your data this won't be a big problem however as the data I have only has state names there will be some overlap.

                       

                      What I've tried to do is use different shapes for each office location so employees working in South Carolina have their home location shown as a Square and North Carolina a diamond. That way you can see the previously hidden employees.

                       

                      I've added a count of employees to the map so the shapes are sized by the number of employees with that home location. The tooltips also hold this information.

                       

                      I hope that is closer to what you want, if you have longitude and latitude figures or zip codes for employees this problem of overlapping marks will be less of an issue.

                       

                      Steve