Returns a set of n elements ordered from smallest to largest, optionally based on an evaluation.
This function ignores tuples that resulted in missing values after evaluating numeric value expression.
Syntax
BottomCount ( set, index [,numeric_value_expression ] )
Parameter | Description |
---|---|
The set from which the bottom n elements are selected. | |
index | The number of elements to be included in the set (n). |
numeric_value_expression | Optional. An expression further defining the selection criteria (see MDX Grammar Rules). |
Example
The following expression
Bottomcount ( [Product].levels(0).members, 10, ( [Sales], [Actual] ) )
returns the set:
{ [200-40], [100-30], [400-30], [300-20], [200-30], [100-20], [100-20], [400-20], [400-10], [300-30] }
Therefore, the following query
SELECT {[Year].levels(1).members} ON COLUMNS, BottomCount ( [Product].levels(0).members, 10, ( [Sales], [Actual] ) ) ON ROWS FROM Sample.Basic WHERE ( [Sales], [Actual] )
returns the grid:
(axis) | Qtr1 | Qtr2 | Qtr3 | Qtr4 |
---|---|---|---|---|
200–40 | 2807 | 2922 | 2756 | 3265 |
100–30 | 3187 | 3182 | 3189 | 3283 |
400–30 | 3763 | 3962 | 3995 | 4041 |
300–20 | 4248 | 4638 | 4556 | 4038 |
200–30 | 4440 | 4562 | 4362 | 4195 |
100–20 | 7276 | 7957 | 8057 | 7179 |
100–20 | 7276 | 7957 | 8057 | 7179 |
400–20 | 7771 | 8332 | 8557 | 8010 |
400–10 | 8614 | 9061 | 9527 | 8957 |
300–30 | 8969 | 9105 | 9553 | 9342 |
See Also