As both hierarchies, [Date].[Calendar]
and [Date].[Is Business Day]
are in teh same dimension, you can rely on SSAS "Autoexists" which is usually faster than Exists
. Hence,
((([Date].[Calendar].[Date].&[20050718].nextmember : null )
*
{ [Date]..Item(0) }
).Item(0)
,[Measures].[SOME MEASURE]
)
The : null
construct builds a set to the end of the Date
level, i. e. to the last day contained in the attribute.
Cross joining with [Date].[Is Business Day].&[True]
automatically restricts the set to those members that co-exist in the dimension (the magic of autoexists).
And .Item(0)
extracts the first tuple. In case you need a tuple not of the date, the .Item(0)
, and the measure member, but just of the date and the measure in your context, apply another Item(0)
after the first. This would extract the first member from the tuple.