Ordinal
The MDX Ordinal function for Essbase returns a generation number or level number.
Syntax
Ordinal ( layer )
Parameters
- layer
-
A layer specification for which to determine the ordinal.
Example
The following example prints generation number and level number for each member in the Product dimension. The value of calculated member [ProdGen]
is a generation number because the input argument to the Ordinal function is a generation. The value of calculated member [ProdLev]
is a level number because the input argument to the Ordinal function is a level.
WITH
MEMBER [Measures].[ProdGen] AS
'Ordinal([Product].CurrentMember.Generation)'
MEMBER [Measures].[ProdLev] AS
'Ordinal([Product].CurrentMember.Level)'
SELECT
{[ProdGen], [ProdLev]} ON COLUMNS,
[Product].Members ON ROWS
FROM Sample.Basic
This query returns the following grid:
Table 4-120 Output Grid from MDX Example
(axis) | ProdGen | ProdLev |
---|---|---|
Product | 3 | 0 |
100 | 2 | 1 |
100-10 | 3 | 0 |
100-20 | 3 | 0 |
100-30 | 3 | 0 |
200 | 3 | 0 |
200-10 | 2 | 1 |
200-20 | 3 | 0 |
200-30 | 3 | 0 |
200-40 | 3 | 0 |
300 | 2 | 1 |
300-10 | 3 | 0 |
300-20 | 3 | 0 |
300-30 | 3 | 0 |
400 | 2 | 1 |
400-10 | 3 | 0 |
400-20 | 3 | 0 |
400-30 | 3 | 0 |
Diet | 2 | 1 |
100-20 | 3 | 0 |
200-20 | 3 | 0 |
300-30 | 3 | 0 |