DerivedExpression

Types

Link copied to clipboard
Link copied to clipboard
object Companion
Link copied to clipboard
class Constant @InternalWowApi constructor(val value: Double) : DerivedExpression
Link copied to clipboard
class MetricRef @InternalWowApi constructor(val metric: String) : DerivedExpression
Link copied to clipboard
class Previous @InternalWowApi constructor(val metric: String, val along: String, val shift: Int = 1, val period: AggregationDateUnit? = null) : DerivedExpression.Window

metric of the group shift steps earlier along the DATE_HISTOGRAM group along, every other group key equal: a step is one bucket of along, the bucket before in its sequence of buckets (across a daylight-saving transition too, never the bucket itself), or one period (such as YEAR for the same period last year: the bucket holding the same local time then). The earlier groups are read over the query's own range of along's field, shifted alike. null when that group has no records.

Link copied to clipboard
class Rank @InternalWowApi constructor(val metric: String, val within: List<String> = emptyList(), val direction: Sort.Direction = Sort.Direction.DESC) : DerivedExpression.Window

The dense rank of metric among the groups that share this group's within keys, in direction: tied values share a rank and ranks have no gaps. null for a group whose value is null.

Link copied to clipboard
class Running @InternalWowApi constructor(val metric: String, val order: Sort, val within: List<String> = emptyList(), val frame: Int? = null, val function: RunningFunction = RunningFunction.SUM) : DerivedExpression.Window

metric accumulated along order over the groups that share this group's within keys: the function of every group up to and including this one, or of the last frame of them. Groups tied on order follow the remaining group keys ascending, in groupBy order. null when every value in the frame is null. SUM accepts only COUNT and SUM; AVG, a moving average with frame, accepts any numeric metric.

Link copied to clipboard
class Total @InternalWowApi constructor(val metric: String, val within: List<String> = emptyList()) : DerivedExpression.Window

The sum of metric over the groups that share this group's within keys, every group when within is empty; null when every value is null. Only COUNT and SUM add up, so only they are accepted.

Link copied to clipboard
sealed interface Window : DerivedExpression

A window over the groups of the aggregation: computed from every group the filter selects, after the row-level derived metrics and before HAVING, sort and limit, so neither HAVING nor the limit changes it. metric names a non-derived numeric metric declared before the derived metric. A null metric value contributes nothing.