
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
50 km radius in qliksense maps
Hi,
I'm aving a map as below and when when i click on site(red dot) the map should zoom into 50 km radius.
Let me know how to get this.
Thanks...
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This can be done with the help of some variables and some math.
Create a variable: vLAT and vLONG
Place the correct lat and long field in each variable. Just the field name.
Use the following formula in your ID for the point or bubble layer:
If(GetSelectedCount([Store ID])>0,
IF(Round(ACOS(SIN(customer lat field*Pi()/180)*SIN($(vLAT)*Pi()/180)+COS(customer lat field*Pi()/180)
*COS($(vLAT)*Pi()/180)*COS(($(vLONG)*Pi()/180)-(customer long field*Pi()/180)))*3963)
<=31.07
,[Cust ID])
,[Cust ID])
Notes:
It appears the store and customer field labels were backwards in your sample data, this is why I don't have the field labels above.
The 31.07 is to get approx. Miles to Kilometers as the formula is for miles.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm explaining more as below.
when user clicks on red dot (store ID) he wants to see all the customers(small dots) with in 50 km range.
gg
- Tags:
- map

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This can be done with the help of some variables and some math.
Create a variable: vLAT and vLONG
Place the correct lat and long field in each variable. Just the field name.
Use the following formula in your ID for the point or bubble layer:
If(GetSelectedCount([Store ID])>0,
IF(Round(ACOS(SIN(customer lat field*Pi()/180)*SIN($(vLAT)*Pi()/180)+COS(customer lat field*Pi()/180)
*COS($(vLAT)*Pi()/180)*COS(($(vLONG)*Pi()/180)-(customer long field*Pi()/180)))*3963)
<=31.07
,[Cust ID])
,[Cust ID])
Notes:
It appears the store and customer field labels were backwards in your sample data, this is why I don't have the field labels above.
The 31.07 is to get approx. Miles to Kilometers as the formula is for miles.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Steven, tried using the formula. It isn't working for me. Tried breaking down the formula and it is returning some values as expected but as formula all together it throwing zero even though there are some zip codes near by. Can you please advise?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you have lat long info for the zip code? Can you show your formula or some information on your set up?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have lat long details for the zip codes and I have used the formula same as you have shared above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is your second set of Lat Long data?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand what do you meant by second set, can you please elaborate. Just for your understanding my requirement here is to select a zip code and see what all zip records that fall under 50 mile radius around it. Can you please advise?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This formula is actually using two separate lat long sets to calculate the distance. In the above example, store data and customer data. The variable contained the store data. The variable will hold the single store lat and long in the formula and then assess the other points in order to see the 50km radius. So you need two separate dimensions and lat long sets. You can use the same ones you just need to create them as unique sets in your load. Hope that makes sense!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Steven_HaughtThanks for the formula, big help!
@venkatadineshqv, I see you're struggling. Make sure that you have done the following:
- Create a field in the following format: [ {longitude} , {latitude} ] as ZipLocation
- Add the ZipLocation as a point layer in your maps object
- Replace the GetSelectedCount with GetPossibleCount in the formula of @Steven_Haught. Because this formula only works if your dimension in the point layer is the same as the one in the formula. If they are different, use the possible one.
If this is not working please show us the configuration of your maps object and a bit of the data.
Jordy
Climber

- « Previous Replies
-
- 1
- 2
- Next Replies »