


3. Re: Grouping Data by distance
Jared Hess Jun 17, 2019 7:56 AM (in response to Vikram Gokhale)I have updated the workbook! Thanks for noticing this!

4. Re: Grouping Data by distance
Jared Hess Jun 17, 2019 8:14 AM (in response to Tim Dines)Still need to group them into a table. Basically if I select Indianapolis, I need it also select all cities within 50 miles and add them as a group.

5. Re: Grouping Data by distance
Tim Dines Jun 18, 2019 7:54 AM (in response to Jared Hess)This is the distance calculation:
3959 * ACOS
(
SIN( RADIANS([Latitude]) ) * SIN( RADIANS([Latitude]) ) +
COS( RADIANS([Latitude]) ) * COS( RADIANS([Latitude]) ) *
COS( RADIANS([Longitude])RADIANS([Longitude]))
)
Circle Longitude:
DEGREES(RADIANS( [Longitude] ) + ATAN2(COS(([Radius])/3959)SIN(RADIANS( [Latitude] ))*SIN(RADIANS( [Circle Latitude] )), SIN(RADIANS([Degree]))*SIN(([Radius])/3959)*COS(RADIANS( [Latitude] ))) )90
Circle Latitude:
DEGREES( ASIN(SIN(RADIANS([Latitude]))*COS(([Radius])/3959) + COS(RADIANS([Latitude]))*SIN(([Radius])/3959)*COS(RADIANS([Degree]))) )
The above calculations define the circle. The radius is a parameter that allows the user to choose any number of distances in miles from the center of the circle. The Degree field is just a field with values 1 to 360. I use this to draw a circle over the map, but you can use this same information to select the names or other dimensions of equipment that fall inside the circle.

6. Re: Grouping Data by distance
Jared Hess Jun 18, 2019 10:00 AM (in response to Tim Dines)I think my biggest confusion is, what would I replace the Degree field with?
I have my distance formula calculated with:
3959 * ACOS(
SIN(RADIANS(LOOKUP(AVG([Lat & Long].[Latitude]), First()))) * SIN(RADIANS(AVG([Lat & Long].[Latitude]))) +
COS(RADIANS(LOOKUP(AVG([Lat & Long].[Latitude]), First()))) * COS(RADIANS(AVG([Lat & Long].[Latitude]))) * COS(RADIANS(AVG([Lat & Long].[Longitude]))  RADIANS(LOOKUP(AVG([Lat & Long].[Longitude]), First())))
)
So when I click on Indianapolis, I want the circle to cover the range of distance for 25,50,75,100 miles. I have the parameter set up when I click on Indianapolis, IN it will automatically change the parameter to Indianapolis, IN. So I am able to plug in the parameter that way. Am I supposed to get the longitude/latitude of the selected city and replace it into the Degree field that you have?

7. Re: Grouping Data by distance
Tim Dines Jun 18, 2019 11:00 AM (in response to Jared Hess)The degree field is the 360 degrees around a circle. I am looking at this as well. It wasn't as straight forward as I made it sound. Sorry to frustrate. If you look at this information from Richard Leeke it will help. Richard Leeke's SuperCharged ZIP Code RadiusFinder