Description
Currently, the VALUES function only accepts one parameter (field), see docs. The values in the output are not sorted.
There are cases though, where we would like to have an output list sorted by some other field. Think of a trendline use-case (see https://github.com/elastic/ml-team/issues/1595) for which we'd like to have output values sorted by their respective @timestamps in order to draw them as a trendline (sparkline).
For that, I propose extend the VALUES function by adding an optional second parameter (name TBD, let's use sortField for now) which will cause the output values to be sorted by their values of sortField.
The change is BWC since the new parameter will be optional.
The VALUES function will need to have access to 2 columns (channels): field and sortField.
Description
Currently, the
VALUESfunction only accepts one parameter (field), see docs. The values in the output are not sorted.There are cases though, where we would like to have an output list sorted by some other field. Think of a trendline use-case (see https://github.com/elastic/ml-team/issues/1595) for which we'd like to have output values sorted by their respective
@timestamps in order to draw them as a trendline (sparkline).For that, I propose extend the
VALUESfunction by adding an optional second parameter (name TBD, let's usesortFieldfor now) which will cause the output values to be sorted by their values ofsortField.The change is BWC since the new parameter will be optional.
The
VALUESfunction will need to have access to 2 columns (channels):fieldandsortField.