6 Replies Latest reply on Jan 6, 2017 8:48 AM by Michael Hesser

    city map for employees

    Nutan Patel

      Hi Experts,

       

      I have data for employees by their duty locations and I want to see this data on city map. The issue i am facing is currently tableau shows dot for each city not for employees in the city. What I want to see is all the employees of specific city should be plotted on map chart. For example, if there are 10 employees in Washington, DC, all 10 employees should be plotted in the area of Washington city.

       

      Here I am attaching packaged workbook along with sample data file. Please do needful.

       

      Nutan Patel

        • 1. Re: city map for employees
          Srinidhi Narayan

          Hello Nutan,

           

          Couple of things I noticed in your data.

           

          1. You want to add the state dimension to the marks card as a level of detail for tableau to recognize and plot the city of Washington accurately. 

          2.  The data IS plotting for each employee.  However, since all employees are in the same city, Tableau plots one dot per employee in the exact same location (as it derives the lat/long based on city name).  The dots are all on top of each other.   If you notice at the bottom left you will see a status that says # marks , # row by # column.   You will notice in your workbook posted there are 8 marks, representing all the respective employees in the two cities that are on the map. 

           

          I realize this probably still doesnt solve your specific problem, but wanted to make sure you are aware of the behavior. 

           

          What specifically do you want to achieve?   One way could be - to add a filter of employee to the viz, and one can select the employee to see his location. 

          • 2. Re: city map for employees
            Stephen Rizzo

            Hi Nunan,

             

            All employees are correctly being plotted on their respective cities - the problem is that the dots for the employees in a given city are all superimposed (try excluding a few to see for yourself). How did you want this displayed?

            • 3. Re: city map for employees
              Michael Hesser

              Hi Nutan-- I'm going to throw in one or two of my observations.

               

              When I read your post, this is the solution I thought of:

               

              For each city, evenly populate dots around a ring (or rings) representing each employee.

               

              This might give you a picture like this:

              or this , depending on how many people are in the city.

              I like about this because it automatically spaces based on how many employees are in the city.

               

               

              At the most basic level, you just need to create a lat/long OFFSET based on the person's unique rank in the city.

               

              Here's where the problem comes in:

               

              Tableau is AWESOME when it comes to generating longitude and latitude, but you can't easily modify the calculated values.. That means even if you could determine the offsets as I have above, you just can't "plug them in" to the lat/long and have them work.

               

              What you could do (and it's a little messy), is compute the lat/long, the offsets, and export it all to new file. Then use the new file to add the offsets to the lat/long and away you go!

               

              Additionally, if you want to get fancy, you can easily add rings based on the total number of people listed for the city.

              • Ring One (center of city) holds 1 person
              • Ring Two (just outside) holds up to 5 people
              • Ring Three (further out) holds 8, and so on

               

              Remember:

              • With this process, some people may wind up living in a lake-- or another city completely, depending how large the circles get
              • If things are too messy, use an ON HOVER action to hide all but the employees in the highlighted city.

               

               

              Good Luck! --Michael

              • 4. Re: city map for employees
                Nutan Patel

                Thanks for sharing this information. I was in the impression that tableau shows only one employee for each city but now I understood it is overlapping the employees. What could be the ideal solution for this ?

                • 5. Re: city map for employees
                  Nutan Patel

                  Hi Michael,

                   

                  Thanks for sharing such a nice thought. Much appreciated.

                  Using your approach, I am able to see dots for each employee on the map but the employees are not correctly mapped with city (even not closer)

                   

                  Following steps I have performed.

                  1) Generated Offset COS & Offset SIN using your formulas

                  2) Exported data with three columns Employee Name, Offset COS & Offset SIN

                  3) Connected this newly generated data and try to prepare map chart. Added Offset COS on columns shelf, Offset SIN on row shelf and Employee Name on detail shelf.

                   

                  Please do needful

                   

                  Thanks

                  Nutan Patel

                  • 6. Re: city map for employees
                    Michael Hesser

                    Hi Nutan...

                     

                    Your exported file should include all your columns, including the generated Lat/Long and generated SIN/COS offsets.

                     

                    Work exclusively from this new file.

                     

                    I think one problem you may have is when you add your OFFSETS to Lat/Long-- the OFFSETS may be too large.

                    You can adjust this manually by adding a REDUCER which you can play with so you get just the right diameter.

                     

                     

                    Multiply each OFFSET by the REDUCER before adding it to the Lat/Long.

                    You can use this process to figure out what a good multiplier should be (I'm not sure).

                     

                    If you want to share your file with detail, I'll be happy to give it a look! --Michael