Sunday, February 2, 2014

"A duplicate attribute key has been found when processing: Table..." Error Causes & Fixes

"Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_TheTable', Column: 'TheColumn', Value: 'XYZ'. The attribute is 'The Attribute'."

There is a number of causes and ways to fix the above error:

  • Could be a result of having both blanks and NULLs in the source table/view. SSAS does
     SELECT DISTINCT  COALESCE(attr,'') FROM SOURCE 
    which converts NULLs to blanks, resulting in duplicate value blanks in the resulting feed - hence the error.
    Solutions : Remove all nulls from the data source by either filtering out rows containing nulls, or update null values with another value before processing the cube. Another solution is to change the way SSAS process nulls, and to do so: go to the cube's Dimension Usage tab, open to edit the relation between the dimension contains the attribute with the error and the measure group, click Advance button, select the attribute in the Measure Group Bindings window, choose the appropriate "Null Processing" option, finally reprocess the cube. The following explains the options for Null Processing:
    • ZeroOrBlank: This tells the server to convert the NULL value to a zero (for numeric data items) or a blank string (for string data items).
    • Preserve: This tells the server to preserve the NULL value. The server has the ability to store NULL just like any other value.
    • Error: This tells the server that a NULL value is illegal in this data item. The server will generate a data integrity error and discard the record.
    • UnknownMember: This tells the server to interpret the NULL value as the unknown member. The server will also generate a data integrity error. This option is applicable only for attribute key columns.
    • Default: This is a conditional default. It implies ZeroOrBlank for dimensions and cubes, and UnknownMember for mining structures and models.
  • Actually, when I was searching for the descriptions of the Null processing, I found a nice two posts by Hilmar Buchta where he list even more than the reasons I wanted to write about:

No comments:

Post a Comment