Linda Cornerstone


In SQL 2005, I have a Snapshot cube. Currently, I set the DefaultMember property on the Day dimension of the Snapshot date using this MDX:

Tail(NonEmptyCrossjoin([Snapshot Date].[Day].Members, 1), 1).Item(0).Item(0)

This worked great until I added future dates into my cube. I need the DefaultMember to be todays date and not the last day in the date dimension.

I am used to using MDX with the Format(Now()) to get today's date but can't get the syntax to work on the properties page: Example: [Snapshot Date].[Hierarchy].[Day].&[" + Format(Now(),"yyyyMMdd") + "]

Can anyone tell me how the MDX should look

Linda



Re: SSAS - Default Member on Day Date Dimension

Deepak Puri


Not sure what the structure of your Day attribute is; but in any case, since the string is dynamically genrated, you would need to convert it to a [Snapshot Date] member, like:

StrToMember("[Snapshot Date].[Hierarchy].[Day].&[" + Format(Now(),"yyyyMMdd") + "]")







Re: SSAS - Default Member on Day Date Dimension

Linda Cornerstone

I knew it was easy...Thanks.

StrToMember("[Snapshot Date].[Day].&[" + Format(Now(),"yyyyMMdd") + "]")