Question:
I want to set current Month as a Default member in my Time Dimension. So that every time i see my data it should display most current data.
Answer:
Here is an example using the Adventure Works cube. You can add this to the cube script for the Adventure Works cube and it will default the day to the current date using the Now() function. I had to use (Now() - 1000) to set the date back to 3/25/2004 due to the fact that the Adventure Works cube Date dimension ends at 8/31/2004, but I think you will get the idea. The other thing to note here is that the [Date].[Date] attribute has a "ValueColumn" defined that is of type "Date". This allows the filter statement to use a straight date vs. date comparison.
-- Now() = 12/19/2006
-- Now() - 1000 = 3/25/2004
ALTER CUBE CURRENTCUBE
UPDATE DIMENSION [Date],
DEFAULT_MEMBER = Tail(Filter([Date].[Date].Members,[Date].[Date].MemberValue < (Now() - 1000)),1)(0);
HTH,
Steve
Steve Pontello
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1036989&SiteID=1
No comments:
Post a Comment