Attribute
Type
Constant String
Since
2.0
Description
Dimensions can be bound in two different ways, with or without attributes.
If you leave this property empty, the dimension defined in the Dimension property will be bound directly (without attribute) to the database (to the SQL-expression defined in the SQL-Expression property). To bind dimensions "directly" means that the cube will search keys with IDs matching the return-value of the SQL-Expression when loading the data. Because all keys have IDs this will bind all keys in a dimension (at all hierarchy levels, including the root key).
But usually you don't want to bind all hierarchy levels with the same SQL-expression to the database and you don't want to bind the root-key of a dimension:
- Different levels of a hierarchy are bound with different SQL-statements (to generate different aggregations) and
- The root level is not bound in the normal case (so the SQL-generator will leave out the dimension for root keys and simple aggregate the values)
Both can be easily done with attributes. Instead of binding the complete hierarchy to a SQL-expression, only keys with a special attribute are bound (the name of the attributes must be defined in this property). Then the SQL-generator only maps keys having this attributes and searches for keys by their attribute-value instead of their ID (which is very useful when using technical ID for keys).
For example a dimension "Product" could have a level 1 containing product-groups with a attribute named "GroupID" and a second level with the products and an attribute name "ProductID". Both attributes could have separate mappings to the database.
If multiple bindings for a dimension exist in a SQL-cube, each with a different attribute, the SQL-generator will create multiple statements and load the data for each key with it's own binding.
Examples
Attribute = "ProductID"
Only bind to keys with "ProductID" (e.g. to a SQL-expression SALES.PRODUCT_ID)
See also
Dimension, Level
