display on a map, all rows from a slice, based on their distance from the current row's LatLong

Hello again!

I have two tables: Current Orders and Past Orders. Both tables have a [Map] column, type LatLong

When I am in the detail view of a Current Order I need an Action which takes me to "another view within the app" which will be a map view, populated by a slice of the Past Orders, filtered by all that are within .5 km of the one Current Order i am viewing.

I basically have it set up without any massive errors, but the map view via the action is not filtered. its showing me all past orders

I can't figure out how to calculate the distance when the LatLongs are in two different tables - I get an error when I try to point at the other table or slice for location2 in this expression

Distance([location1],[location2]) :

 

SLICE: (name = "withinhalfkm")

AND(
ISNOTBLANK([PastOrdersMap]),
(DISTANCE([PastOrdersMap], [_THISROW].[CurrentOrderMap]) < 0.5)
)

Deep Link:

CONCATENATE("#page=map&table=withinhalfkm&mapcolumn=Map&row=", ENCODEURL([_THISROW]))

Solved Solved
1 1 118
1 ACCEPTED SOLUTION

How about using LINKTOFILTEREDVIEW() in navigation action in the "Current Orders" detail view. I believe, this will not need a slice to be created unless slice is also required for some other purpose.

LINKTOFILTEREDVIEW("Past Orders Summary View", DISTANCE([PastOrdersMap]- [_THISROW].[CurrentOrderMap])<=0.5)

Here "Past Orders Summary View" is the summary view that you are already having for "Past Orders" table to display multiple past orders in the app.

View solution in original post

1 REPLY 1

How about using LINKTOFILTEREDVIEW() in navigation action in the "Current Orders" detail view. I believe, this will not need a slice to be created unless slice is also required for some other purpose.

LINKTOFILTEREDVIEW("Past Orders Summary View", DISTANCE([PastOrdersMap]- [_THISROW].[CurrentOrderMap])<=0.5)

Here "Past Orders Summary View" is the summary view that you are already having for "Past Orders" table to display multiple past orders in the app.

Top Labels in this Space