Extracts a member from a tuple.
Extracts a tuple from a set.
Syntax
Syntax that Returns a Member—one of the following:
tuple[.Item] ( index ) Item ( tuple, index )
Syntax that Returns a Tuple—one of the following:
set[.Item] ( index ) Item ( set, index )
Parameter | Description |
---|---|
The tuple from which to get a member. | |
index | The usage depends upon whether you are returning a member or a tuple:
|
The set from which to get a tuple. |
Example
Example 1, Extracting a Member from a Tuple
SELECT {( [Qtr1], [Sales], [Cola], [Florida], [Actual] ).Item(3)} ON COLUMNS FROM Sample.Basic
returns:
Florida |
---|
5029 |
SELECT {Item(( [Qtr1], [Sales], [Cola], [Florida], [Actual] ), 2)} ON COLUMNS FROM Sample.Basic
returns:
Cola |
---|
22777 |
Example 2, Extracting a Tuple from a Set
The following query
SELECT {CrossJoin ( [Market].CHILDREN, [Product].CHILDREN ).ITEM(0)} ON COLUMNS FROM Sample.Basic
returns the first tuple in the set CrossJoin([Market].CHILDREN, [Product].CHILDREN), which is ([East], [Colas]):
The above query can also be written as:
SELECT {CrossJoin ( [Market].CHILDREN, [Product].CHILDREN )(0)} ON COLUMNS FROM Sample.Basic
because the ITEM keyword is optional.
Example 3, Extracting Member from a Set
Consider the following crossjoined set of Market and Product members:
{ ([East],[100]),([East],[200]),([East],[300]),([East],[400]),([East],[Diet]), ([West],[100]),([West],[200]),([West],[300]),([West],[400]),([West],[Diet]), ([South],[100]),([South],[200]),([South],[300]),([South],[400]),([South],[Diet]), ([Central],[100]),([Central],[200]),([Central],[300]),([Central],[400]),([Central],[Diet]) }
The following example
CrossJoin([Market].CHILDREN, [Product].CHILDREN).item(0)
returns the first tuple of the crossjoined set, ([East],[100]), and the following example
CrossJoin([Market].CHILDREN, [Product].CHILDREN).item(0).item(1)
returns [100], the second member of the first tuple of the crossjoined set.