Skip to content

topk-others-min

Input Stack:
k: Int
stat: String
expr: TimeSeriesExpr
Output Stack:
TimeSeriesExpr
 
 

Select the top K time series based on a summary statistic and aggregate all remaining series into a single "others" line using minimum aggregation. This provides a way to focus on the highest performers while showing the minimum value among all excluded series.

Parameters

  • expr: A grouped time series expression (typically the result of :by)
  • stat: Summary statistic to rank by (see :stat for available options)
  • k: Number of top-performing time series to display individually

Behavior

  1. Ranking: Evaluates all time series using the specified summary statistic
  2. Selection: Selects the K series with the largest statistic values
  3. Aggregation: Combines all remaining series using :min aggregation
  4. Output: Returns K+1 time series (K individual + 1 "others" minimum)

Examples

Show top 2 clusters by maximum value, with minimum of others:

BeforeAfter
name,sps,:eq,
(,nf.cluster,),:by
name,sps,:eq,
(,nf.cluster,),:by,
max,2,:topk-others-min

Since: 1.7