Display functions operate on the result set of a query.
Function | Example | Description |
---|---|---|
BottomN |
|
Returns the n lowest values of expression, ranked from lowest to highest. |
Filter |
|
Computes the expression using the given preaggregate filter. |
Mavg |
|
Calculates a moving average (mean) for the last n rows of data in the result set, inclusive of the current row. |
Msum |
|
Calculates a moving sum for the last n rows of data, inclusive of the current row. The sum for the first row is equal to the numeric expression for the first row. The sum for the second row is calculated by taking the sum of the first two rows of data, and so on. When the nth row is reached, the sum is calculated based on the last n rows of data. |
NTile |
|
Determines the rank of a value in terms of a user-specified range. It returns integers to represent any range of ranks. The example shows a range from 1 to 100, with the lowest sale = 1 and the highest sale = 100. |
Percentile |
|
Calculates a percent rank for each value satisfying the numeric expression argument. The percentile rank ranges are from 0 (1st percentile) to 1 (100th percentile), inclusive. |
Rank |
|
Calculates the rank for each value satisfying the numeric expression argument. The highest number is assigned a rank of 1, and each successive rank is assigned the next consecutive integer (2, 3, 4,...). If certain values are equal, they are assigned the same rank (for example, 1, 1, 1, 4, 5, 5, 7...). |
Rcount |
|
Takes a set of records as input and counts the number of records encountered so far. |
Rmax |
|
Takes a set of records as input and shows the maximum value based on records encountered so far. The specified data type must be one that can be ordered. |
Rmin |
|
Takes a set of records as input and shows the minimum value based on records encountered so far. The specified data type must be one that can be ordered. |
Rsum |
|
Calculates a running sum based on records encountered so far. The sum for the first row is equal to the numeric expression for the first row. The sum for the second row is calculated by taking the sum of the first two rows of data, and so on. |
TopN |
|
Returns the n highest values of expression, ranked from highest to lowest. |