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?
Member of LinkedIn
. My blog at SQLKover
MCSA SQL Server 2012 - MCSE Business Intelligence