My goal is to grab people within a certain distance from a specified city. Right now, I set the coordinates for the city in the load script, and call it later in the haversine formula (which works). I would prefer to allow the front end user to choose the city dynamically so I don't have to reload the app every time they want to choose a new city. Here is my current script, along with an example city (set variable). The "Zip" maps to a user DB, and brings along all of their information.
//Miami LET Lat2 = 25.7617; LET Long2 = -80.1918;
//========================================== //Load USCities3 from Attached files //==========================================
LOAD City2, Zipcode2 as Zip, Lat3, Long3, GeoMakePoint(Lat3,Long3) as Location,
FROM [lib://AttachedFiles/USCities3.xlsx] (ooxml, embedded labels, table is Sheet1)
I tried bringing in a duplicate table (USCities3) and renaming the fields so they won't associate with the other table (and left out the haversine). I concatenated them, and did a resident load since lat2/long2 wouldn't be found otherwise. The "city" fields still query each other, so I get no output.
Sorry for the delay, I have been out of town. This got me really close to where I want to be. I think I can figure it out for here, but may comment again. This is really good stuff, and I have some other use cases for it.