I am working on a fishing app and need to calculate the distance between two LatLong points. This distance is “by the way the crow flies” so I know I can use Distance(). I have a simple table called ‘Location’ Here is the AppSheet Columns view of this table.
I want the column DistanceTraveled to be the distance between column [Location] and the [Location] from the previous row.
Within the DistanceTraveled column I used the following DISTANCE() expression in the Auto Compute App formula: Distance([Location], [_THISROW_BEFORE].[Location])
The answer that results is 0.
I know there is likely a simple answer, but I just can’t figure it out. I’m not a programmer or app builder, but rather a physician learning appsheet to keep my mind off COVID. Thanks!
Solved! Go to Solution.
Try:
ANY(
SELECT(
Location[Location],
(
[_ROWNUMBER]
= MAX(
SELECT(
Location[_ROWNUMBER],
([_ROWNUMBER] < [_THISROW].[_ROWNUMBER])
)
)
)
)
)
Try:
ANY(
SELECT(
Location[Location],
(
[_ROWNUMBER]
= MAX(
SELECT(
Location[_ROWNUMBER],
([_ROWNUMBER] < [_THISROW].[_ROWNUMBER])
)
)
)
)
)
Thank you @Steve! Worked well! I initially thought the units for Distance() were meters. But based on my results it seems they are km. Is that correct?
Yes it’s correct.
User | Count |
---|---|
36 | |
31 | |
28 | |
23 | |
18 |