8 Replies Latest reply on Jan 3, 2014 9:39 AM by jonathan.richman.2

    Combine two mark types for different data on same map

    jonathan.richman.2

      I have two sets of data. The first is a list of customer addresses (including street name/number, city, state, ZIP code). I have no problem plotting all of these on a map represented by a shape. The next set of data is store locations (including street name/number, city, state, ZIP code). What I'd like to do is overlay the customers (represented by a single shape/color) on top of the store locations (represented with a different shape/color). I've tried a number of ways to do this, but keep getting stuck. I thought I could simply do a dual axis, but when I go to the second data source to drag over another latitude (generated), it's grayed out.

       

      Any thoughts would be appreciated.


      Thanks,

      JR

       

      Adding sample workbook with dummy data. This excludes street addresses, but I think illustrates the problem.

       

      Message was edited by: Jonathan Richman (added sample workbook)

        • 1. Re: Combine two mark types for different data on same map
          Matt Lutton

          Any chance you can post some sample data in a packaged workbook?  I'd certainly take a look, although I am not an expert -- however, posting a workbook will increase your chances of getting good help from more qualified helpers as well. you could trim and dummy down your data set, if needed, before posting. Cheers!

          • 2. Re: Combine two mark types for different data on same map
            jonathan.richman.2

            I wish I could post an example workbook, but I obviously can't post the customer addresses. The store locations are a little less sensitive, but I don't want to post the full street addresses of these either, so my client can have a little anonymity. So, unfortunately, there's no way to post something that's meaningful.

             

            Bottom line is this: I have two files with addresses (street number/name, city, state, ZIP). They aren't linked in a way that makes sense and should be viewed as independent. I can plot one or the other on a map with no problem. I would like to show the addresses from both lists on a single map. One shape for the list of customer addresses (e.g., circles) and one shape for the store locations (e.g., squares).

             

            Some mock data would basically be two unrelated lists of addresses, but I don't have ready access to something like this.

            • 3. Re: Combine two mark types for different data on same map
              Matt Lutton

              I understand.  It may be worthwhile to randomize some of your data.  You can probably find lists of addresses pretty easily online, and there are likely sample data sets available with this kind of data.

               

              I understand your hesitancy, and I was there myself several months ago.  However, I have discovered that you are far more likely to get excellent help with some sample data ready and posted.  Otherwise, for someone (like me) who doesn't know the answer off the top of my head, I have to go out and create two sample data sets of my own, pull them into Tableau, and then try to "imagine" what your data structure or view setup would look like in my head.  Not an easy task, so most folks will simply browse over the thread.

               

              However, someone may chime in with a correct answer or an example of their own--it does happen, and I am sure there are some folks who can give you a solution without seeing any data.  I just want to encourage you to do some data prep when asking questions on the forum, as it makes everything much simpler.  If its not possible, its not possible--but usually, it is, it just requires a bit of work.

               

              Cheers.

              • 4. Re: Combine two mark types for different data on same map
                jonathan.richman.2

                I've been able to come up with blinded data for most of my other questions, but struggling with this one for now. I'll come up with something. Probably will just leave out street address because that will get the point across in principle and I can figure it out from there.

                • 5. Re: Combine two mark types for different data on same map
                  Matt Lutton

                  Some sample data found here:

                  Free Sample Data

                   

                  I know there are more sites others have posted here.  I wouldn't leave out street addresses; just use fake ones.  It is ideal if the sample data matches the structure of your own data, so transferring what you learn to your production workbook will be simpler.

                   

                  Cheers.

                  • 6. Re: Re: Combine two mark types for different data on same map
                    jonathan.richman.2

                    I guess give this a shot...

                     

                    I left out the street addresses as I put this together after seeing your comment. I'm sure I can figure it out if someone just tells me if what I want to do is possible.

                     

                    The problem I've figured out is that because I have to link at least one dimension, when I try to show both sets of marks, the map shows one set of marks (e.g., locations) and then in the other axis (customer addresses), it shows only cities (if that's what was used to link) that overlap the first set of marks....if that makes any sense.

                     

                    Thanks for taking a look.

                     

                    Best,

                    JR

                    • 7. Re: Combine two mark types for different data on same map
                      Matt Lutton

                      Have you tried, or thought about, using a JOIN rather than using Data Blending?  I did not realize you were dealing with a data blend scenario (two separate data sources, not joined)

                      • 8. Re: Re: Combine two mark types for different data on same map
                        jonathan.richman.2

                        Okay...so I think I came up with something workable, but it's really pretty "janky". I read a ton of other support posts before coming up with the idea of creating a union of my two data sources into a single data source (one file). So, I have now (in one file) a list of customers (with their addresses) and at the end of these rows a list of my locations. They don't share column headers. So, for example, I have a ZIP code column for customer rows (that includes their ZIP code), which is Null for a row with a location. I have a Zip code_2 column that is just the opposite (Null for a customer row, but a zip code in a row with a location). Tableau still recognizes Zip code_2 as being a ZIP code, so it is able to plot it correctly.

                         

                        I didn't think this would work, but with a little playing around, I got it working (sort of). See attached.

                         

                        The blue squares represent store locations (that are placed by ZIP code) and the red circles represent addresses (actually just ZIP code) for each customer. If there is more than one customer in a ZIP code, the circles are colored to indicate that.

                         

                        The limit is that the location and customer address is placed right in the center of the ZIP code versus the actual latitude and longitude, but I'll save that effort for another day.

                         

                        Take a look and let me know what I'm missing, but I think this basically works.

                         

                        Thanks,

                        JR