Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssas attribute key cannot be found even though it exists and is not due to duplicates

I was trying to rebuild my cube after making some changes the other day to the table/column names in the fact and dimension tables.

The process cube action kept returning the following error message:

The attribute key cannot be found when processing: Table: 'MyFactTableName', Column: 'MyDimensionKey', Value: 'SomeValue'. The attribute is 'MyDimensionKey'.

The other answers to similar questions referred to attributes with duplicate values, and cases where the attribute value was null in the or missing in either the Dimension or the Fact table.

Example related posts are:

  • ssas dimension processing key not found error
  • key not found error

There were no duplicate values in my case and the attribute value was not missing from either the Fact or Dimension table.

Thankfully the information in this post here solved my problem.

The suggestion was to process the affected Dimension by itself, and then process the affected measure group.

Any idea why this happens, how I could reproduce this? I'd like to know so that I can avoid it next time or so that it doesn't pop up again at a bad time while deploying an upgrade to the production environment.

Thanks in advance for your help.

EDIT: I'm using SSAS-2008, and the error occurred while trying to process the cube from within BIDS-2008.

like image 424
JM Hicks Avatar asked Dec 20 '12 14:12

JM Hicks


2 Answers

This happens because your measure group is processed before the related dimensions. SSAS comes across a foreign key that's used to relate to a cube dimension, but the key is not known to the dimension itself.

like image 95
Jeroen Bolle Avatar answered Sep 27 '22 21:09

Jeroen Bolle


Root cause of this error: There is some key is present in your Fact Table, which in turn is not present in your Dimension table (Ideally which should not be the case) Try following steps:

  1. Process your dimensions before processing Measure Groups

  2. If your "SomeValue" is 0, then try adding default (0th) row in your dimension table and in Fact table try putting ISNULL(MyDimensionKey,0)

  3. If above 2 solutions doesn't work, try this: a. Right-click on your cube db, go to "process" >> "Change Setting" b. Go to "Dimension key errors" tab c. Check "Use custom error configuration" radio button d. Check 'Ignore error count' radio button. For 'Key not found' select 'Ignore error'. Similarly for 'Null key not allowed' also selecy 'Ignore error' e. Click on OK and try processing your cube

like image 40
Monica Boyal Avatar answered Sep 27 '22 20:09

Monica Boyal