BottomCount

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 ] )
ParameterDescription

set

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)Qtr1Qtr2Qtr3Qtr4
200–402807292227563265
100–303187318231893283
400–303763396239954041
300–204248463845564038
200–304440456243624195
100–207276795780577179
100–207276795780577179
400–207771833285578010
400–108614906195278957
300–308969910595539342

See Also

  • TopCount