Association Element (CSDL)

SQL Server 2012

The Association element in the BI Extensions for CSDL (Conceptual Schema Definition Language) extends the existing CSDL Association element by adding attributes that can be used to control the visibility of elements that are involved in a relationship.

The Association element is for the most part identical to the Association element defined by the CSDL specification, which has the following child elements:

  • Documentation elements

  • End elements

  • Annotation elements

The following table lists the attributes that are found on the Association element.

Attribute Name

Is Required

Value

Name

Yes

The name of the association.

State

No

(extension) A string enumeration that indicates whether the association is used in the data model.

Hidden

No

(extension) A true/false value that indicates whether the Association is visible in the data model.

There is one Association in each AssociationSet. The AssociationSet describes the Association end points and also includes any roles defined for that association. By default the name of the AssociationSet is the same as the name of the Association.

An Association is created whenever there is a relationship between two tables or views. Because Analysis Services tabular models support the creation of multiple associations between two tables, one of the associations must be marked as the preferred or active association. For example, the Sales table might have multiple relationships to the table used as the Date dimension, with dates from the Date dimension linked to order dates, shipping dates, and invoice dates. The multiple paths can lead to ambiguity and wrong results in calculations unless the relationship to use is explicitly specified. For more information about working with relationships in tabular models, see Relationships (SSAS Tabular).

The following example shows the definition of an Association that connects the tables InternetSales and Date, using the DateKey columns of the respective tables.

Caution note Caution

If the columns that are the end points have the same name, a GUID is sometimes generated to make the name unique. This behavior may change in a future release.

Note that the AssociationSet is marked as Inactive. This tells you that another relationship exists between the two tables, using different columns, and that the other relationship is currently preferred for creating calculations.

<AssociationSet Name="InternetSales_Date_Date_DateKey" Association="Sandbox.InternetSales_Date_Date_DateKey">
              <End EntitySet="InternetSales" />
              <End EntitySet="Date" />
      <bi:AssociationSet State="Inactive" />

Community Additions

ADD
Show: