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: Count (Set)
Category: Statistical
Description: The Count(Set) function returns the number of members in a set.
Syntax: COUNT( «Set»[, EXCLUDEEMPTY | INCLUDEEMPTY] )
«Set».COUNT
Technet Link: MDX Count (Set) Function




The query above can be re-written using the Set.Count syntax as shown below.
 
WITH
      MEMBER [Measures].[SetCount] AS
      [Product].[Product].[Product].Members.Count
SELECT
      {[Measures].[SetCount]} ON COLUMNS
     
FROM
      [Adventure Works]
 
 

 
The query below returns the count of products members.
 
WITH
      MEMBER [Measures].[SetCount] AS
      COUNT([Product].[Product].[Product].Members)
SELECT
      {[Measures].[SetCount]} ON COLUMNS
     
FROM
      [Adventure Works]
 
 

 
 

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