A duplicate attribute key has been found...

  • 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?

  • 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.

  • yea, when i get the quarter, i get the year and the quarter, so quarters are returned as:

    2008Q1

    2008Q2

    2008Q3

    2008Q4

    2009Q1

    etc

  • 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.

  • 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.

  • 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

  • When this has happened to me I have forgotten to deploy changes to the dimension before deploying the cube.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply