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: BottomSum
Category: Set
Description: The BottomSum function returns a set that is sorted in ascending order. The cumulative sum of this set is less than or equal to the supplied value for the supplied measure.
Syntax: BOTTOMSUM( «Set», «Value», «Numeric Expression» )
Technet Link: MDX BottomSum Function




The query below returns a set of Products with the lowest values whose cumulative Sales Amount total is less than or equal to 10,000. Notice the BottomSum function returns products with empty values.
 

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

 
The following query returns a non empty set of Products with the lowest values whose cumulative Sales Amount is less than or equal to 10,000.
 

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

 
 

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