Is there any way to compare a fixed value to a list of values, and return the closest match in the list?

Ryan_S
New Member

Is there any way to compare a fixed value to a list of values, and return the closest match in the list?
It’s all numeric

I’ve got a fixed list returned from a select operation on another table (Could be 1 result, could be 100 results) and a single value in my current table. Need the closest match from the list. Been at this problem for about 2hrs now

Solved Solved
0 10 792
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

This will give you closest row:

ANY(
  ORDERBY(
    FILTER(
      "table",
      select-expr
    ),
    ABS([_THISROW].[value] - [value])
  )
)

replacing table, select-expr and value with the appropriate table name, row selection expression, and value column name, respectively.

View solution in original post

10 REPLIES 10
Top Labels in this Space