Hi,
I have the Latitude and longitude data of stores in the following format.
| Group | Store | Latitude | Longitude |
| 1 | a | 10.111 | 12.222 |
| 1 | b | 12.222 | 16.3323 |
| 1 | c | 16.745 | 12.222 |
| 2 | d | 18.3232 | 93.233 |
| 2 | e | 12.3344 | 17.432 |
| 2 | f | 17.343 | 13.6565 |
I am trying to find the nearest store for each store (for which I have a formula to calculate distance using lat/long). I have to do it within each group, and result has to be distance of the nearest store for each store. I read about Batch macros, but finding it difficult to map the flow. Can someone please help me.
the formula is use:
ACOS
(
COS([Latitude]*(pi()/180))*COS([Row+1:Latitude]*(pi()/180))
+
SIN([Latitude]*(pi()/180))
*
SIN([Row+1:Latitude]*(pi()/180))
*
COS(([Longitude]-[Row+1:Longitude])*(Pi()/180))
)
*6371