If I understand your question correctly, you asking how your write MDX to
always use the last month of your date dimension (rather than specifying the
last date in the query)?
You could use the MDX tail function to get that information.
We have a simular requirement for our Analysis services database, and ended
up doing something a little bit different.
Assuming you are using AS2005 (could be done in AS2000, but would require
changes to your underlying data structure I think...)
-In your data source view, add a calculated column (in our case, I called it
yesterday).
-The code I put in was an SQL case statement that checked that date stored
in that row against the current system date. If it was yesterday, returned
true, otherwise false. Our cubes get processed daily.
-I then added the "Yesterday" column into the date dimension. Now, when
queries are written, rather than having to specify the actual date of
yesterday, I just need to specify Yesterday.true. The same type of idea
should work for what you want, assuming I understand your question.
-Ryan
<wall.andrew (AT) gmail (DOT) com> wrote
Quote:
Hi
I am new to mdx and am struggling trying to get the last value in my
time dimension. I want to return the last cout of the Time.Month
attribute and put it in a calc member...does this break hierarchies?
Running SQL 2005 SSAS.
Help
a |