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! Go to Solution.
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.
User | Count |
---|---|
18 | |
11 | |
7 | |
5 | |
5 |