Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

A duplicate attribute key has been found... Expand / Collapse
Author
Message
Posted Thursday, April 22, 2010 10:23 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 9:43 AM
Points: 902, Visits: 1,857
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?
Post #908818
Posted Thursday, April 22, 2010 10:55 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: Wednesday, August 6, 2014 8:12 AM
Points: 1,815, Visits: 3,456
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.
Post #908856
Posted Thursday, April 22, 2010 11:37 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 9:43 AM
Points: 902, Visits: 1,857
yea, when i get the quarter, i get the year and the quarter, so quarters are returned as:

2008Q1
2008Q2
2008Q3
2008Q4
2009Q1

etc
Post #908877
Posted Thursday, April 22, 2010 11:46 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: Wednesday, August 6, 2014 8:12 AM
Points: 1,815, Visits: 3,456
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.
Post #908884
Posted Thursday, April 22, 2010 4:11 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 9:43 AM
Points: 902, Visits: 1,857
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.
Post #909073
Posted Monday, April 26, 2010 9:52 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, May 23, 2014 9:02 AM
Points: 216, Visits: 424
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 ;)

Cheers,



Rick Todd
Post #910498
Posted Tuesday, September 3, 2013 4:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 19, 2014 7:41 PM
Points: 2, Visits: 117
When this has happened to me I have forgotten to deploy changes to the dimension before deploying the cube.
Post #1490861
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse