• subscribe
December 20, 2000 12:00 AM

Customize Time Dimension Member Names

SQL Server Pro
InstantDoc ID #16311

SQL Server 2000 Analysis Services' and SQL Server 7.0 OLAP Services' Dimension Wizard automatically creates member names, but the names don't always include the member's relevant time period. However, you can customize these generated Time dimension member names. First, from the Dimension Editor, select each level in turn in the tree pane, and change the Member Name Column property to the unique name you choose. Here are some examples of unique member names; these examples use a Time dimension table called Dates that has a date field called Date:

Year Level

DatePart(year,"Dates"."Date")

Quarter Level

'Q'+ CONVERT(varChar,DatePart(q,"Dates"."Date")) + '/' +
CONVERT(varchar,DatePart(year,"Dates"."Date"))

Month Level

CONVERT(varChar,DatePart(m,"Dates"."Date")) + '/' +
CONVERT(varchar,DatePart(year,"Dates"."Date"))

Day Level (European Notation)

CONVERT(varChar,DatePart(d,"Dates"."Date")) + '/' +
CONVERT(varChar,DatePart(m,"Dates"."Date")) + '/' +
CONVERT(varchar,DatePart(year,"Dates"."Date"))

Day Level (US Notation)

CONVERT(varChar,DatePart(m,"Dates"."Date")) + '/' +
CONVERT(varChar,DatePart(d,"Dates"."Date")) + '/' +
CONVERT(varchar,DatePart(year,"Dates"."Date"))


ARTICLE TOOLS

Comments
  • Chris McDermott
    11 years ago
    Dec 21, 2001

    This is one of the best articles I have seen on Analysis Services Time dimensions. Well done Mr.Levin, please continue in this vein.

You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...