I need an MDX query to get the last element of a dimension so that the entry in the Cube is non empty.
Imagine the Cube having the following Dimensions:
- Instrument (String)
- Item Index (Integer in increasing order)
- Measure dimension
Now, I want the last Item Index that has non zero entries.
This is what I came up with, but it’s not working:
SELECT { [Measure Dimension].MEMBERS} ON 0 ,
Filter( {Item Index] .Members} , [Measure Dimension].[First Measure] <> "" ) ON 1
FROM [CubeName]
Where ( [Instrument].[XYZ9998] )
Thanks for any suggestion.