Home      Functions     Common Solutions      Contact     






MDX Functions:
 
MDX Functions

 
Common Solutions

Common Solutions
 
Resource Links

MDX Books
MDX Related Software
MDX Related Blogs
 
Other Links

Contact Us
 
Microsoft SQL Server Analysis Services Function Page
Function Name: BottomCount
Category: Set
Description: The BottomCount function sorts a set in ascending order, then returns a specified number of members with the lowest values.
Syntax: BOTTOMNCOUNT( «Set», «Count»[, «Numeric Expression»] )
Technet Link: MDX BottomCount Function




The query below returns 10 products that have the lowest Internet Sales Amount. Notice that all records returned are null. To get the lowest 10 products that have a value, see the next query.
 

SELECT
      {[Measures].[Internet Sales Amount]} ON COLUMNS,
      BOTTOMCOUNT([Product].[Product].Members ,10 , [Measures].[Internet Sales Amount]) ON ROWS
FROM
      [Adventure Works]
 
 

 
This query returns the 10 products (that are non empty) that have the lowest Internet Sales Amount.
 

SELECT
      {[Measures].[Internet Sales Amount]} ON COLUMNS,
      BOTTOMCOUNT(FILTER([Product].[Product].Members, NOT ISEMPTY([Measures].[Internet Sales Amount])) , 10 , [Measures].[Internet Sales Amount]) ON ROWS
FROM
      [Adventure Works]
 
 

 
 

 
Copyright 2008 by MDXpert.com.
 
Terms of Use                              Privacy Statement
 
Site Powered By - WinHost.Com