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.
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.
      MEMBER [Measures].[CurrOrd] AS
      GENERATE([Product].[Product Line].Members AS
      [ANamedSet], [ANamedSet].CurrentOrdinal, " | ")
      {[Measures].[CurrOrd]} ON COLUMNS
      [Adventure Works]


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