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: CurrentOrdinal
Category: Navigation
Description: The CurrentOrdinal function returns the current iteration number within a set during iteration.
Syntax: «Set».CURRENTORDINAL
Technet Link: MDX CurrentOrdinal Function




The query below uses the Generate function to iterate over the six members of the Product Line hierarchy. The CurrOrd calculated member returns a string that shows the six CurrentOrdinal numbers separated by the pipe character.
 
WITH
      MEMBER [Measures].[CurrOrd] AS
      GENERATE([Product].[Product Line].Members AS
      [ANamedSet], [ANamedSet].CurrentOrdinal, " | ")
SELECT
      {[Measures].[CurrOrd]} ON COLUMNS
     
FROM
      [Adventure Works]
 
 

 
 

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