Sunday, February 19, 2012

AMO - Dimension Composite Key

i'm developing an aplication in order to create a cube on the fly, and i'm confuse with something that i read at the Msdn's web site, the doubt that i have is about composite keys in Dimension Tables, after read this paragraph (extracted from - http://msdn2.microsoft.com/en-us/library/ms345091.aspx - "Creating Dropping and Finding Dimensions) .

" The primary key attribute of the dimension should be defined as

AttributeUsage.Key to make clear that this attribute is the key access

to the dimension "

It's like the Dimension Tables must have a unique atributte as PK right ?, but what happens if my Dim Tables have a compositeKey ?.

Is necessary to create a UNIQUE atribute as PK in the Dimension Tables ?

The Key attribute of a dimension can have a composite key - an example is the [Internet Sales Order Details] dimension in Adventure Works, with key columns of {SalesOrderNumber, SalesOrderLineNumber}. In terms of AMO, multiple DataItems could be added to an attribute's KeyColumns collection:

http://msdn2.microsoft.com/zh-cn/library/microsoft.analysisservices.dimensionattribute.keycolumns.aspx

>>

DimensionAttribute.KeyColumns Property

Gets the collection of key column definitions for DimensionAttribute.

...

>>

|||Thank you Deepak, I look the Adventure Works -Amo example and like you see its possible to have a composite key in a Dimension Table (it makes sense :) ).

I saw that they "rename" this composite key with ' Sales Order Key ', i suposse this is like create on the fly a unique PK that encapsulates the composite key, in order to be used later at the measureGroup creation, am i wrong ?.

Thanks for your fast reply!!!

cheers Lisber.

No comments:

Post a Comment