quantile
Returns the rank of a value within a range that you specify. It returns integers to represent any range of ranks, such as 1 (highest) to 100 (lowest). The "<for-option>" defines the scope of the function. The "at" option defines the level of aggregation and can be used only in the context of relational datasources.
Syntax
quantile ( numeric_expression , numeric_expression [ at expression { ,
expression } ] [ <for-option> ] [ prefilter ] )
quantile ( numeric_expression , numeric_expression [ <for-option> ]
[ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
quantile ( Qty , 4 )
Result
Returns the quantity, the rank of the quantity value, and the quantity values broken down into 4 quantile groups (quartiles).
Result data
Qty | Rank | Quantile (Qty, 4) |
---|---|---|
800 | 1 | 1 |
700 | 2 | 1 |
600 | 3 | 2 |
500 | 4 | 2 |
400 | 5 | 3 |
400 | 5 | 3 |
200 | 7 | 4 |
200 | 7 | 4 |