none
Duplicate attribute key in date Dimension

    Question

  • Hi,

    I have created a date dimension using this code

    http://www.codeproject.com/Articles/647950/Create-and-Populate-Date-Dimension-for-Data-Wareho

    It contains one attribute 'Month'

    I have created one fact table which contains the following dates


    1. StartDate
    2. EndDate
    3. CreationDate
    4. CompletionDate
    5. AssignedDate
    6. ReceivedDate
    7. ActualStartDate
    8. AcutualEndDate
    9. DecisionDate

    I have created a relationship with date dimension created by using above code. Relationship of above attributes have been created with DimDate.Date attribute. I have not created Calendar Hierarchy yet. 

    When I am processing the cube I am getting the following error

    Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dim_Date', Column: 'Month', Value: '10'. The attribute is 'Month'.

    In date dimension have data from 1990 to 2050. so Month is being repeated for each year. I am not sure Why am I getting this error.

    Any Help much appreciated.


    MH

    Monday, January 13, 2014 2:55 PM

Answers

All replies

  • You should be linking to the Date dimension by using DateKey which should be surrogate key created on table and not using Month field. Once related this way you would still be able to do slicing dicing using Month values and it will show rolledup measures upto month level.

    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    Monday, January 13, 2014 3:02 PM
  • Hi Visakh,

    Thanks for your prompt reply. I am linking to the date dimension using date i.e. StartDate to DimDate.Date and so on for other fields not using month. Do I need to create named queries in DSV? Because in fact table I have all the date columns contains dates because data type is date. 

    So either I have convert them into integer at the time of loading the fact table. WHat do you suggest? 


    MH

    Monday, January 13, 2014 3:15 PM
  • Hi Mustafah,

    For the error "Errors in the OLAP storage engine: A duplicate attribute key has been found when rocessing: Table: <tablename>, Column: <columnname>. Value: <value>. The attribute is <attributename>", it  can occur in multiple situations. In many cases, the recommended solution is to change the KeyColumn by setting it to a unique attribute, or by creating a composite key that results in a unique value when multiple attributes are evaluated as a unit. Here are some document which describe this error and the solution of it.

    References:
    Analysis Services: Errors in the OLAP storage engine: A duplicate attribute key has been found when processing
    You get “A duplicate attribute key has been found when processing ..” error message when processing a dimension
    A duplicate attribute key has been found when processing

    Regards,
    Charlie Liao

    If you have any feedback on our support, please click here.


    Charlie Liao
    TechNet Community Support

    • Marked as answer by MustafaH Wednesday, January 15, 2014 12:07 PM
    • Unmarked as answer by MustafaH Thursday, January 16, 2014 3:55 PM
    • Proposed as answer by Dhwani Sudanagunta (MCTS) Friday, January 17, 2014 5:07 AM
    Tuesday, January 14, 2014 7:16 AM
    Moderator
  • Hi All,

    Thanks for all your replies, I have made few changes as suggested, I am getting duplication attribute key error in Quarter field now, this error does not come if I process the cube with out calendar hierarchy. I have alot of fields in date dimension but I only picked DateKey, Date, Month, Quarter, Year. I have created an Hierarchy and it is DateKey - > Date -> Month - > Quarter - > Year and I am getting an error Duplicate Attribute Key Quarter 4. Not able to understand, 

    Any Help much appreciated.


    MH

    Thursday, January 16, 2014 3:52 PM
  • As suggested before you will be able to process cube successfully only if you chose a uique attribute as key which is why i suggested to choose datekey as attribute.

    And you will still be able to rollup the results to any other level like Querter,Year etc even when you chose key as DateKey


    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    Thursday, January 16, 2014 4:16 PM
  • Hi Thanks for your reply, I have done that let me show you the screen shot, What is wrong in this? As suggested Date Key is unique in this format 20130502 etc.


    MH

    Thursday, January 16, 2014 4:23 PM
  • Hi,

    I found the answer and this is the answer, 

    http://www.bidn.com/blogs/DevinKnight/ssis/1887/ssas-understanding-keycolumns-dimension-property

    Many thanks for all your help.


    MH

    • Marked as answer by MustafaH Thursday, January 16, 2014 4:36 PM
    Thursday, January 16, 2014 4:36 PM