Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Ordinal (MDX)

Returns the zero-based ordinal value associated with a level.



A valid Multidimensional Expressions (MDX) expression that returns a level.

The Ordinal function is frequently used in conjunction with the IIF and CurrentMember functions to conditionally display different values at different hierarchy levels, based on the ordinal position of each specific cell in the query result. For example, you can use the Ordinal function to perform calculations at certain levels and display a default value of "N/A" at other levels.


The following example returns the ordinal number for the Calendar Quarter level in the Calendar hierarchy.

WITH MEMBER Measures.x AS [Date].[Calendar].[Calendar Quarter].Ordinal
SELECT Measures.x on 0
FROM [Adventure Works]
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft