I have a list of locations (app_dropspots) with a LATLONG field (vir_lat_long) and similar to several posts here I'm hoping to display the closest location to the logged in user in a drop down list.
In order to test from desktop, I'm using my exact LatLong vs. HERE() in the ValidIf of a dropdown box tied to another table and here's the reference:
ORDERBY(
FILTER("app_dropspots",TRUE),
DISTANCE([vir_lat_long],LATLONG(mylatlong))*0.621371
)
When I display the dropdown I can see the locations are not sorted in distance order (I've added the distance calc in the name of the location for testing). I've tried a SELECT statement as well but no luck
Can someone help with what might be keeping the list from sorting correctly?
The ORDERBY() sort parameter must use something that can be used to select a set of rows to determine where in the order the rows belong. A calculated value has no relationship to any specific rows.
The easiest way to solve this is to add a distance column to the table with an App Formula. Then sort by that distance column.
NOTE: What is "mylatlong"? Is is supposed to be referring to a column?
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |