About Dimension Attributes

A dimension attribute represents a single data element in the dimension, and is linked to one or more columns of an underlying dataset. There are two kinds of dimension attributes: level attributes and secondary attributes.

WARNING: AtScale does NOT recommend mapping a level key or a dimensional attribute key to a floating point number data warehouse column. Doing so will prevent AtScale from applying certain performance optimizations. This is especially applicable to large result sets for Excel queries, but applies to all business intelligence tool queries.

Level Attributes

Level attributes are those that are associated with a particular hierarchy. Every hierarchy has a key level attribute, which is the most granular representation of the dimension's data. Only level attributes can be used to define relationships between datasets and other dimensions.

For example, in this Geography dimension hierarchy, there are four level attributes (Country, State, City, and GeoKey), which are each associated with one or more underlying data columns.

/public/images/Container_Dimension_LevelAttrib.png

Secondary Attributes

Dimension attributes that are not the dimension's key, and not a level of a hierarchy are called secondary attributes. For example, firstname and lastname are attributes about a user, but they don't make sense as part of a hierarchy.

A secondary attribute cannot be used to define relationships, but the level they are connected to can be.

Note: You can build tabular reports that use hierarchy-specific calculations, such as Time Calculations, without specifying the Hierarchy in the report or query. For more information, see Dimensions.

/public/images/Container_Dimension_SecondAttrib.png

Attribute Type: Dimensional

The default Secondary Attribute Type provides an independent "Dimensional" attribute for grouping metric data. Dimensional Secondary Attributes may be referenced from calculated metrics by following the canonical MDX syntax of [Dimension Name].[Hierarchy Name].[Level Name], however the "Hiearchy Name" and "Level Name" are both set to the Attribute's Name. For example, if you define a secondary attribute of "QuarterOfYear" on a hierarchy of the Date dimension, then such an attribute is referenced from a calculated metric as: [Date].[QuarterOfYear].[QuarterOfYear]. Note that the secondary attribute reference is independent of the Design Center Hierarchy that displays it.

Attribute Type: Level Alias

Secondary Attributes of type "Level Alias" enable the creation of tabular reports that select hierarchical expressions without forcing the user to drill down a hierarchy. For example, consider a tabular report of Monthly Sales vs Last Year Month Sales. The "Last Year Month Sales" calculation is easily computed using an AtScale ParallelPeriod function as follows:

(ParallelPeriod(
[Order Date Dimension].[Order Retail445].[Order Reporting_Year], 1,
[Order Date Dimension].[Order Retail445].CurrentMember),
[Measures].[salesamount1])

Because this expression uses a hierarchy's CurrentMember function, it is necessary for the report designer to include the [Order Date Dimension].[Order Retail445] hierarchy in the report. When including a hierarchy in the report, most BI Tools force the user to navigate the hierarchy to the desired level, month in this case. Besides being a usability inconvenience, this interaction pattern causes the calculation of level subtotals that the report designer is not interested in.

These problems can be avoided by using a Secondary Attribute that aliases a hierarchy level. In this case, the problem is solved by defining an "Order Month" secondary attribute as an alias for the [Order Date Dimension].[Order Retail445].[Order Month] level. The report designer can then use the "Order Month" Secondary Attribute with the "Last Year Month Sales" calculation without forcing the user to navigate a hierarchy. As a result, the BI Tools display the data at the Month level without forcing the navigation of a hierarchy and without computing unnecessary subtotals.

When configuring the Secondary Attribute as an alias of a level, it is important that calculated metrics continue to reference the Hierarchy Level directly. Do not rewrite the calculated metric to reference the level alias. Doing so executes an inner query which may return different results than expected.

To create level aliases, you must edit the dimensiom's underlying SML to include the aliases property. For more information, see Dimensions.

Attribute Type: Metrical

To create secondary metrical attributes, you must edit the dimensiom's underlying SML to include the metrics property. For more information, see Dimensions.

Using Dimension Attributes in Calculated Metrics

You can evaluate dimension attribute values in a calculated metric formula. Doing so is useful for conditional processing of metric values based on the value of a given dimension attribute. For more information, including the syntax to use, see CURRENTMEMBER.NAME in AtScale's MDX reference.