14 Replies Latest reply: Apr 22, 2013 5:26 AM by Abs Sheoran RSS

    Dynamic Maps


      I am trying to solve a complex problem in QlikView using maps.



      In my data set that is a single excel data file I have 6 data feilds with following names - Lat1, Long1, Lat2, Long2, Lat3, Long3

      These data columns contain latitude and longitude in them.

      I have other three data fields Opt1, Opt2, Opt 3 (Option data fields) which contains values 1 or 0



      So the data looks like this in my excel sheet:








      QlikView Objects: Now I need to have a UK map in Qlikview and a drop down box that contains option - Option1, Option2, Option3.



      • When I select Option1 from the drop down list then the map should show only the Lat1 and Long1 locations on the UK map that have Opt1 value equal 1.
      • When I select Option2 from the drop down list then the map should show only the Lat2 and Long2 locations on the UK map that have Opt2 value equal 1.
      • When I select Option3 from the drop down list then the map should show only the Lat3 and Long3 locations on the UK map that have Opt3 value equal 1.


      **I tried to use the google maps but I need to have some key and when I search for that key the google web page says that they are not available**


      Kindly help, If you need more info please let me know. I will provide more details.


        • Re: Dynamic Maps
          Michael Solomovich

          Setting aside the google maps (you'll find many working solutions here), here is you can do.
          Create a variable "Option" which can have only one of three values, Opt1, Opt2, Opt3.  Use input box with drop-down.
          Your expressions in maps will be using latitude and longitude:
          .... lat... long ...

          Replace with conditional in all expressions:
          ... pick(match(Option, 'Opt1','Opt2','Opt3'), lat1,lat2,lat3)...pick(match(Option, 'Opt1','Opt2','Opt3'), long1,long2,long3)



          • Re: Dynamic Maps

            Hi Michael

            Can you give me the exact expression that will go in the expression box as the expression you mentioned has got some dots.



              • Re: Dynamic Maps
                Michael Solomovich

                Not sure it will help you because there are varuiables here, and I don't know if you have them, and the field names can be different.

                1st expression

                = avg( round (256*pow(2,($(var_zoom)-1)))+( longitude  *((256*pow(2,$(var_zoom)))/360)) )

                2nd expression


                3rd expression is for the bubble size, whatever you use there.

                And, the dynamic image expression on the colors tab:

                & num(var_mid_lat, '##############', '.', ',' )
                & ','
                num(var_mid_long, '##############', '.', ',' )
                & '&zoom=$(var_zoom)'
                & '&size='&
                & '&maptype='&



                • Re: Dynamic Maps
                  sivasankar kanagasabai

                  Asheoran, Received your mail. Attaching the qvw for you to get an idea.Also am attaching an excel sheet where you can use the tables individually and concatenate in the script to achive the solution. This may help. Regards. Siva

                    • Re: Dynamic Maps

                      Hi Siva

                      Thanks a lot for helping thats really helpful of you.

                      Intially it was the data model that was creating trouble and was making everything complex. So I changed the data model and now it look like this.



                      As compared to earlier in this data model I have replaced the Opt1,Opt2,Opt3,Opt4,... with one single column with name Scenario_Number and added another column with name Scenario_Detail which can only have 0s or 1s as value.

                      For a specific Scenario_Number, Scenario_Detail values tell which Latitude and Longitude should be displayed on map (when the value is 1 then that latitude & longitude should be displayed)

                      And all the Lat's and Long's are stored in just two columns - Latitude1 and Longitutde1 (If you look at the data set that I have attached with this post things will be more clear).


                      Now we can have a listbox/multibox via which we can select a Scenario_Number and corresponding values of Latitude1 & Longitude1 should be displayed.

                      I do not need to display any other dimention such as population etc.


                      So I worked on the the QlikView file that you gave me and loaded the data and changed few things in the script but its still not working.

                      Can you tell me where I am going wrong?

                  • Re: Dynamic Maps

                    Hey Experts

                    You guys have been really helpful I was finally able to implement google maps in my QlikView document.

                    Now I am stuck on the map size. I tried to change it but was not able to.


                    Can anyone tell me if there is anyway we can change the size of the map.