Returns: A member or a tuple.
>>-+-SetExpression--.--Item--(--IndexExpression--)---+--------->< '-TupleExpression--.--Item--(--IndexExpression--)-'
In this example, you want to see the last month that had sales activity, and the hierarchy of this month. The following query uses the Item function to return the sales amount for the last month in the cube that has a non-null value and all ascendants of that month.
SELECT {[Price Analysis].[Measures].[Sales Amount]}
ON AXIS(0),
{Ascendants(Tail(Filter([Price Analysis].[Time].[Calendar Month Level
(Price Analysis)].Members,
Not IsEmpty([Price Analysis].[Time].CurrentMember))).Item(0))}
ON AXIS(1)
FROM [Price Analysis]
| Time | Sales amount |
|---|---|
| 10 | 95087.53 |
| 4 | 95087.53 |
| 2004 | 1003053.47 |
| All Time (Calendar) | 2719121.06 |