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: TopPercent
Category: Set
Description: The TopPercent function sorts a set in descending order, then returns tuples from the top of the set with the highest values whose cumulative total is greater than or equal to the supplied percentage.
Syntax: TOPPERCENT( «Set», «Percentage», «Numeric Expression» )
Technet Link: MDX TopPercent Function




The query below returns the top 10 percent of Products with the highest Sales Amount.
 

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

 
The following query returns the top 10 percent of Dates from the Fiscal hierarchy of the Date dimension with the highest Sales Amount.
 

SELECT
      {[Measures].[Sales Amount]} ON COLUMNS,
      TOPPERCENT([Date].[Fiscal].[Date].Members, 10, [Measures].[Sales Amount]) ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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