Select Nearest Row and Quick Edit

I know there have been a few posts about this, and before I posted my own question, I looked at all of them (I think.) 

I'm trying to create an action that will select the nearest site to the currently selected row and enable quick edit.

Can anyone weigh in on whether I am close at all with this expression? It leads me to a blank screen that the emulator is just calling "&quickedit=true".

Again, apologies for asking a question that's been asked in different forms before. 

My table is called realm2, the key is "AssetNumber" and "LatLong" is...lat, long.

Thanks for taking a look!

LINKTOROW(
ANY(
SELECT(
realm2[AssetNumber],
AND(
IN([LatLong],
ORDERBY(
FILTER("realm2",
AND(
[AssetNumber] <> [_THISROW].[AssetNumber],
NOT(IN([AssetNumber], LIST([_THISROW].[AssetNumber]))),
ISNOTBLANK([LatLong])
)
),
DISTANCE([LatLong], [_THISROW].[LatLong])
)
),
ISNOTBLANK([LatLong])
)
)
),
"&quickedit=true"
)

Solved Solved
0 8 203
1 ACCEPTED SOLUTION

This should work:

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          AND(
            ISNOTBLANK([LatLong]),
            [_THISROW]<>[AssetNumber]
          )
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      1
    )
  ),
  "&quickedit=true"
)

And this may be a better option (withouth AND):

CONCATENATE(
  LINKTOROW(
    INDEX(
      ORDERBY(
        FILTER(
          "realm2",
          ISNOTBLANK([LatLong])
        ),
        DISTANCE([LatLong], [_THISROW].[LatLong])
      ),
      2
    )
  ),
  "&quickedit=true"
)

 

View solution in original post

8 REPLIES 8
Top Labels in this Space