MDX CASE Example (Calculated Member – DateTime Format)

Rewrote my previous post, so it can be used within your MDX statement.

WITH
MEMBER [Measures].[MonthName] AS
CASE MONTH([Time].[Month].MEMBERVALUE)
WHEN 1 THEN “January”
WHEN 2 THEN “February”
WHEN 3 THEN “March”
WHEN 4 THEN “April”
WHEN 5 THEN “May”
WHEN 6 THEN “June”
WHEN 7 THEN “July”
WHEN 8 THEN “August”
WHEN 9 THEN “September”
WHEN 10 THEN “October”
WHEN 11 THEN “November”
WHEN 12 THEN “December”
END

[Time].[Month] value= [Time].[Month].&[2010-01-01T00:00:00]

For “January 2010”, just use:
WHEN 1 THEN (“January ” + STR(YEAR([Time].[Fiscal Month].MEMBERVALUE)))

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s