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


A duplicate attribute key has been found...


A duplicate attribute key has been found...

Author
Message
winston Smith
winston Smith
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1807 Visits: 2069
im going through an exercise book with examples of SSAS cube creation and deployment.

One exercise is to create a time dimension in a cube. The dimension is created from a date column already in the fact table.

The Time Dimension has 4 attributes:

Date -pk
Month
quarter
year

when i try to process the dimension i get the error:

Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_ManufacturingFact', Column: 'YearOfManufacture', Value: '2008'. The attribute is 'Quarter'.


I have completely emptied all dimension and fact tables and repopulated them but issue still exists.

I have recreated the time dimension, ensuring to set up the hierarchy correctly so that each child can have only one parent ( see this article: http://blog.programmingsolution.net/ssas-2008/period-dimension-time-dimension-creation-with-year-month-day-hierarchy/)

I have tried setting MemberNamesUnique to false, and setting the trim property to NONE, but still facing the issue.


I ran a trace when trying to process the dimension, and only two queries are run, first returning all the distinct quarters, and the second returning all distinct years and their quarters.

I cant see any duplicates so i cannot see where this error is comming from. any ideas?
stevefromOZ
stevefromOZ
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: Moderators
Points: 3542 Visits: 3757
Do you have your attribute relationships set up in the dimension? To avoid this style of issue, we also generally create unique keys for each attribute value. So for e.g., if you have the following info (simplified)

Year Quarter

2008 Q1
2008 Q2
2008 Q3
2008 Q4
2009 Q1
2009 Q2

we would set the key for quarter to be something like 2008Q1 and 2009Q1 rather than simply Q1 for both years.

Steve.
winston Smith
winston Smith
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1807 Visits: 2069
yea, when i get the quarter, i get the year and the quarter, so quarters are returned as:

2008Q1
2008Q2
2008Q3
2008Q4
2009Q1

etc
stevefromOZ
stevefromOZ
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: Moderators
Points: 3542 Visits: 3757
Went and read the link you supplied - if you followed that to the letter, it should all be working. The only other thing I can think of is that you have one (or more) quarters without a name. This would support the error message indicating that the dupe occurred in the Quarter attribute but the value it displays is '2008'. If you have blanks/nulls you could isnull it to coerce it into a single value.

Steve.
winston Smith
winston Smith
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1807 Visits: 2069
So i done all kinds of querying on the data, and couldnt find any duplicate data.
I then emptied all the dimension and fact tables again, repopulated them, redeployed , and now the dimensions populated successfully. I really dont know why it messed up the first time. Its an example from a book so im chalking it down to an issue with something in that.

anyway, its working now. thanks for the replies folks.
Rick Todd
Rick Todd
SSC Veteran
SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)

Group: General Forum Members
Points: 292 Visits: 441
My $.02: I usually find when I get that error it's because I have NULL values. I make myself crazy trying to find problems with the data, when it's actually problems with a lack of data Wink

Cheers,


Rick Todd
cabbagetreecustard
cabbagetreecustard
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 127
When this has happened to me I have forgotten to deploy changes to the dimension before deploying the cube.
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