Skip to main content

BottomCount

Sorts a specified set in ascending order, and returns a specified number of elements with the lowest values.

Syntax

BottomCount(Set_Expression, Count [,Numeric_Expression])  

Input parameters

Set_Expression

An MDX expression that returns a set.

Count

The number of tuples to return.

Numeric_Expression

Optional. An MDX expression defining cell coordinates that return a number.

If this value is specified, the set is sorted in ascending order according to the value of this expression as evaluated over the set. BottomCount then returns the specified number of elements with the lowest values.

If this value is not specified, BottomCount returns the set without sorting, similar to the Tail function.

Example

The following example sorts the expression [Product].[Product Categories].AllMembers in ascending order according to the value specified by [Measures].[Internet Sales Amount Local], and returns the tuples with the 10 lowest values:

BottomCount(
[Product].[Product Categories].AllMembers,
10,
[Measures].[Internet Sales Amount Local]
)