SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSAS 2008 with Adventure Works


SSAS 2008 with Adventure Works

Author
Message
Dennis Klemenz
Dennis Klemenz
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 101
I'm working on setting up a 2008 SSAS database using Visual Studio 2008. We have AdventureWorksDW2008R2 as our database in SQL Server 2008 R2. We created a cube in VS 2008 and brought in the dimension "Dim Date" with the fact table called "Internet Sales".

We can deploy no problem but the issue is when we try to build attribute relationships. When we build this relationship, it works fine:
Date Key --> Full Date Alternate Key --> English Month Name --> Calendar Quarter --> Calendar Semester

The moment we add Calendar Year, it fails saying: "Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_DimDate', Column: 'CalendarSemester', Value: '2'. The attribute is 'Calendar Semester'."
Date Key --> Full Date Alternate Key --> English Month Name --> Calendar Quarter --> Calendar Semester --> Calendar Year

Where are we going wrong? We're having issues with this duplicate error in almost every other attribute relationship we setup. We created a different attribute relationship for our Customer dimension for Gender and Martial Status and we got the exact same issue - except duplicate value in Martial Status is (S).

We are creating the relationships because we intend to setup hierarchies. The hierarchies work fine without the relationships so we are a bit perplexed.

Here is what we've checked:
1.) Quarter, Semester and Year contain NO NULLs
2.) Quarter, Semester and Year do duplicate (as we'd expect for each date). What is wierd is why does it work without Year in the relationships but it works with Semester & Quarter?

Where are we going wrong here?
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59173 Visits: 13297
The problem is that semester is not unique for each year.

"What?", do you think, "has he gone out of his mind?"

The answer is yes, but that's besides the point.
When you look at the actual values for semester, you'll find 1 and 2.
If you look at semester 2, you have no way of telling to which year it belongs.
That's because semester 2 occurs in every year. Hence the duplicate key error.

The trick is to change the key for semester. When you look at the properties of the semester attribute, somewhere at the bottom you have the key column.
This is default the attribute semester itself. Change this to year + semester. This will garantee to be unique.
Change the name column to semester. This can sometimes be confusing (as you have the same 2 values for each year), so most of the time a calculated column is used for the name column. For example "Semester Friendly", with values like "2013 S02".

You would use this attribute to compare the semesters of each year with each other. For example: "How was the sales in semester 1 of 2013 compared with the sales of semester 1 in 2012?"

You can also keep an attribute like you originally had (just semester 1 and 2). This can be used for analysis: "How does semester 1 compares with semester 2 over all the years?" You just cannot use it in an attribute hierarchy with year.

Typically they give different names to those attributes: "semester" and "semester of year".
You have the same issue with weeks, months and quarters.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Dennis Klemenz
Dennis Klemenz
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 101
Thanks so much for the detailed explanation, it worked like a charm. From a usability standpoint, I'm disappointed that it is so complex to implement but I now understand the situation much better. Thanks again.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search