Ordinal (MDX)
Returns the zero-based ordinal value associated with a level.
Syntax
Level_Expression.Ordinal
Arguments
Level_Expression
A valid Multidimensional Expressions (MDX) expression that returns a level.
Remarks
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.
Example
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]
See Also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho