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: Levels
Category: Metadata
Description: The Levels function returns a level for the specified number (zero-based index) or specified name.
Syntax: «Hierarchy».LEVELS( «Numeric Expression» )
Technet Link: MDX Levels Function




The query below returns the all level (by number) for the fiscal hierarchy of the Date dimension.
 

SELECT
      {} ON COLUMNS,
      {[Date].[Fiscal].Levels(0)} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below returns the Month level (by number) for the fiscal hierarchy of the Date dimension.
 

SELECT
      {} ON COLUMNS,
      {[Date].[Fiscal].Levels(4)} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below returns the Quarter level (by name) for the fiscal hierarchy of the Date dimension.
 

SELECT
      {} ON COLUMNS,
      {[Date].[Fiscal].Levels("Fiscal Quarter")} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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