# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for
Did you mean:
Highlighted Contributor II

## 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...

1 Solution

Accepted Solutions
Highlighted Creator III

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. 2 Replies
Highlighted Contributor II

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 Highlighted Creator III

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.  