Customize Time Dimension Member Names

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"))

Discuss this Article 1

Chris McDermott (not verified)
on 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.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottOur Experts will show you:
• Common SQL Server
Problems
• Best Practices for T-SQL
• SQL Server Integration
Services
• Database Development

Come See Mike Otey & Tim Ford in Person!

Early Registration Now Open

From the Blogs
May 9, 2013
blog

My ISO 8601-Compliant Signature 2

My family recently just "officially" announced that we're in the process of adopting a child from South Africa. We're quite excited, of course, but there's a ton of paperwork to do—along with the need for gobs of signatures....More
May 8, 2013
blog

Use SSIS for ETL from Hadoop

In this blog post, Mark Kromer walks you through using SSIS as a way to use ETL techniques using Microsoft's Hadoop on Windows (HDInsight) as a source using Hive connectors...More
Vision road sign
May 6, 2013
blog

Cheaters Never Win, Even in TPC Benchmarks

In this portion of the series on database benchmarking, I want to tell you about one of my favorite aspects of the TPC benchmarks – CHEATING....More
SQL Server Pro Forums

Get answers to questions, share tips, and engage with the SQL Server community in our Forums.