14 Replies Latest reply on Nov 4, 2016 7:07 AM by Yuriy Fal Branched to a new discussion.

    Combining a Polygon Map with a Point Map

    naresh.suglani.0

      Guys, please could you help with a problem I have with a mapping exercise? I have 2 maps that I have created. The first is a heat map of local authorities in the UK shown below:

       

      Screenshot 1.jpg

      The second is a point map showing locations of managers in the UK shown below:

       

      Screenshot 2.jpg

       

      I want to combine the 2 maps so that the points are overlaid over the heat map but using the exercises I've found on the net I can't get it to work properly. I have added a second Latitude and Longitude and set both to dual axis then added in the manager location and set the appearance to circles but this simply changes the whole map to circles as shown below:

       

      Screenshot 3.jpg

       

      What am I doing wrong? The heat map was created using polygons for the local authorities and the manager locations were displayed using the long and lat data.

       

      Thanks in advance.

        • 1. Re: Combining a Polygon Map with a Point Map
          Mahfooj Khan

          Hi Naresh,

           

          Yeah this can be done using dual axis map. Go through the link where I've given some solution which is very similar to your scenario.

          Dual Axis Maps

          If you still unable to get the correct output then kindly share a sample workbook in .twbx format. Feel free to ask If you've any question.

           

          Mahfooj

          • 2. Re: Combining a Polygon Map with a Point Map
            naresh.suglani.0

            Hi Majfooj thanks for your quick reply.

             

            I followed the steps in the link you sent and it only highlighted the polygons areas which the manager locations fell into and lost the original heat map colours. I only need point locations to be displayed (if possible) over the heat map. I have attached the workbook below so let me know if you can get it working for me please.

             

            Keep up the good work, this is a great little forum that I'm sure I'll be using on a regular basis!

            • 3. Re: Combining a Polygon Map with a Point Map
              Mahfooj Khan

              Hi Naresh,

               

              You've used multiple data sources. You have to join the sources to achieve this. There should be some joining keys so that you can join both sources. I've analysed and found a common field and able to join the sources. You can go to Data tab and edit relationships option to see the joining fields. I don't have knowledge about your data. However have a look what I've got

               

              Relationships used

               

              Hope this help.

               

               

              Mahfooj

              • 4. Re: Combining a Polygon Map with a Point Map
                naresh.suglani.0

                Hi Mahfooj,

                 

                Thanks for taking the time to do this analysis for me, however the result is still not what I needed to show and I'm not sure how you created those multiple fields on the GC Licensed Premises tab. What I need to show is the original heat map and ONLY the point locations shown on the CM Locations tab (32 points) which relate to manager's names (which I'd also like to show on a key/legend).

                 

                I just need those points on the map as I want to show the Manager names. The dataset containing the names have exact coordinates for their locations so it should be possible to display just those as shown on the CM Locations tab but simply overlaid on top of the heat map.

                 

                Is it possible to do this please? If so I'm guessing I would need to introduce another field in the data just to show these 32 points because, at present, the point map you created shows too many points on there.

                 

                If that can be done it would be perfect.

                 

                Regards,

                Naresh

                • 5. Re: Combining a Polygon Map with a Point Map
                  naresh.suglani.0

                  Also I noticed I haven't got the option of multiple marks on my version of Tableau - which version are you using? I have version 10.0 here.

                  • 6. Re: Combining a Polygon Map with a Point Map
                    Mahfooj Khan

                    I've used the same version of Tableau 10.0.x

                    I know CM location has 32 points which contains information of managers. To get only 32 dots overlay on GC then you've to link both the data sources. In tableau If you're connecting more than one data source and If you wants to show data from both the sources then there should be some commonality between the sources like common fields. Here I haven't found any common columns except Name(from GC data) and Local Authority(from CM). To get the correct output you've to first join the sources.

                    I've put CM on color to make it visible. NULL and * coming because after joining there are some Name(from GC) which are not present in your CM source.

                    Useful kb article which can give you brief idea about combining two different data sources.

                    Combining Multiple Data Sources into One View | Tableau Software

                     

                    Let me know If you've any query.

                     

                    Mahfooj

                    • 7. Re: Combining a Polygon Map with a Point Map
                      naresh.suglani.0

                      Ok thanks this seems to be going in the right direction but I need to get rid of all the Null and * points. As you know that Name and Local Authority are unique identifying fields what do you suggest I do to only display the 32 Manager names only?

                       

                      I would appreciate if you could spare some time to do this for me so I can then follow what you have done. I can then show my colleagues at work that it is possible to create these kind of maps.

                       

                      Thanks in advance.

                       

                      Kind regards,

                      Naresh

                      • 8. Re: Combining a Polygon Map with a Point Map
                        Yuriy Fal

                        Hi all,

                         

                        There is a limitation (restriction) of Tableau

                        where only one pair of Lat / Lon fields

                        is allowed for a view (incl Dual Axis one).

                         

                        With that in mind, to show both LA & Managers

                        on a single view, one should have them both

                        in a single datasource. Blending couldn't help either,

                        since only the Lat/Lon fields from Primary are used.

                         

                        So in this case, blending doesn't place Managers' Marks

                        to their own Lat/Lon places, but they're going to their

                        Local Authorities ones instead.

                         

                        Besides, there are two LAs managed by a couple of Managers each.

                        For those Managers their Marks are placed on top of each other.

                         

                        The approach I would like to suggest

                        is making a single datasource for this view (only)

                        by UNIONing both LA and Managers tables

                        and JOINing Inspections table to them.

                         

                        Please find the attached workbook & datasource.

                        Hope it could help a bit.

                         

                        Yours,

                        Yuri

                        • 9. Re: Combining a Polygon Map with a Point Map
                          naresh.suglani.0

                          Thanks Yuriy for your reply. I will take a look at the workbooks you provided either today or tomorrow and let you know how I get one.

                          • 10. Re: Combining a Polygon Map with a Point Map
                            naresh.suglani.0

                            Hi Yuriy,

                             

                            Thanks for the attached files. I am still getting stuck though when trying to recreate what you did so could you provide me a solution with a step by step guide please? I need to produce several more maps that combine both polygons and points on the same map by local authority so a detailed guide would help with this process for me personally, rather than try to re-create it from looking at a completed map.

                             

                            Thank you in advance.

                             

                            Naresh

                            • 11. Re: Combining a Polygon Map with a Point Map
                              naresh.suglani.0

                              Guys, just to let you know that I have managed to get this working, so that I now both a polygon heat map and a point map combined together.

                               

                              However, for the point map, I get some null values all showing at a single point location for some reason, not sure why. If I remove this from the Legend then the heat map colours disappear. Why would that happen? When I remove all records relating to the null values then several of the polygons also get removed.

                               

                              Can anyone explain what is happening and if they can offer assistance please?

                              • 12. Re: Combining a Polygon Map with a Point Map
                                Yuriy Fal

                                Hi Naresh,

                                 

                                I'd like to help, but it's hard to advise anything

                                without looking at the view first.

                                 

                                What field are those NULL values coming from?

                                It couldn't be just NULLs :-) Are they coming from

                                the datasource field, or as a result of a calculation?

                                 

                                Have you had a workbook to look at?

                                Or could you happen to have those NULLs

                                using my workbook as an example?

                                 

                                Yours,

                                Yuri

                                • 13. Re: Combining a Polygon Map with a Point Map
                                  naresh.suglani.0

                                  Hi Yuri, I have attached the file I'm using. If you exclude the Null values from the "Premises Type" filter on the "Deprivation Map" tab then all the colours from the heat map disappear.

                                  • 14. Re: Combining a Polygon Map with a Point Map
                                    Yuriy Fal

                                    Hi Naresh,

                                     

                                    That's because of the [Category] field (on which the filter is built)

                                    has no values (hence NULLs) in the GB LA Extract table.

                                     

                                    Since the polygons are coming from the GB LA Extract table,

                                    excluding NULL removes them from the view.

                                     

                                    On the point map Pane all those datasource rows from GB LA Extract

                                    are collapsed into a single Mark with the AVG(Lat/Lon) for the whole set.

                                     

                                    I could find three ways to work around the problem:

                                     

                                    1. via Parameter. Applied only when choosing (All) or only one Category (no multi-select).

                                     

                                    2. via Filter Action. Allows multi-select, but the user experience is different then from a common filter.

                                     

                                    3. via Join. Essentially it is a duplication of rows in the GB LA Extract table for each Category value.

                                     

                                    Please find the attached all three ones as different workbooks

                                    (and the datasource for the third one, though it could be extracted from the wb itself).

                                    Hope it could help (one way or another).

                                     

                                    Yours,

                                    Yuri