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: TopCount
Category: Set
Description: The TopCount function sorts a set in descending order, then returns a specified number of members with the highest values.
Syntax: TOPCOUNT( «Set», «Count»[, «Numeric Expression»] )
Technet Link: MDX TopCount Function




The query below returns 10 products that have the highest Internet Sales Amount.
 

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

 
The query below returns the top 25 Dates in the Fiscal hierarchy with the highest Order Count.
 

SELECT
      {[Measures].[Order Count]} ON COLUMNS,
      TOPCOUNT([Date].[Fiscal].[Date].Members ,25 , [Measures].[Order Count]) ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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