Submitted byCategory
Review Cycle
.
Public
Joachim Mutter/sysarc
on 02/24/2009 at 12:56 PM
SSaS\Doku

OLAP Engine "Attribute key not found"

Problem description


During the deployment of an OLAP database you may run into errors of type "Attribute key not found". Mostly you will find hints in documentation and the internet, which points to the problem of missing dimension entries for facts / measures and no existing default entry for the appropriate dimension. Others speak of deploy dimensions before the facts and so on.

Unfortunately, these hints doesn't help really further in my kind of error. All needed dimension keys exists, there is an default entry with the surrogate key -1 and all other stuff, which makes healthy dimensions. Further more, the errors occurred during the deployment of the dimension, or of the facts !

In my case, most of the errors point to dimension entries, which had an accent or vowels like "ä,ü, ö", etc in the faulty terms, but unfortunately not all of them. So the speculation was obvious, that there must be something wrong with some international settings. But the whole architecture with identical data works on three systems (English and German SQLServer 2005). With the German versions on one system without errors and on the other with errors. There are also no errors on the English development system!

After some long debug sessions, data comparison orgies and parameter checks, I found out that the errors may depend on the database collation settings. The database server, which shows these problems and which hosts the dimensional database for the OLAP load , used in it's default settings the Collate order "Latin1_General_CI_AI", means "Accent insensitive". So all databases used this collation order as default, there was no explicit setting to use defined one.

A test with one of the dimension tables, where I changed an appropriate columns collation order from "Latin1_General_CI_AI" to "Latin1_General_CI_AS", (Accent sensitive), showed a reduction of the error counts during the OLAP deployment.

Detailed investigations of the errors in this direction and with the given informations from the error text (which is not really self explaining) clarify what exactly happened during the deployment. The exact error behaviour could be at the end of this chapter.


Conclusion:




Analyse


If you look a bit more keen to the error description and extract the available informations from it, you could create a SQL select statement to extract appropriate entries from the base table of the dimension. The surprising result of the statement was the fact, that there were more than one entry coming back. With the information Collate order is "Latin1_General_CI_AI" in the mind, the result really makes sense, the two entries were identical for the database engine. The terms "Krämer" and "Kramer" have no differences, if you compare them without accent sensitive settings. So the first entry "Kramer" gets the Dimension-Key and the following entry has no unique Dimension-Key, which is the reason of the "Key not found" errors.