## Relations

All relations for each table are listed under Relations under the table. This means that the same relation is listed under both the tables involved.

Each relation has a default name that consist of the two table names with a "-" between, but it can be renamed. A relation contains one or more relation items, i.e. relations between two fields.

#### Adding Relations

When adding relations, the available settings depend on the endpoint types you have selected for the model - see Adding a Semantic Model.

To add a new relation on a model where Qlik is the only endpoint type enabled

- Drag a field from one table on the model to field on another table and the click
**Yes**when asked if you want to add a relation.

To add a new relation on a model where the endpoint type SSAS Tabular or Tableau is enabled, follow the steps below.

- Drag a field from one table on the model to field on another table. If the cardinality of the tables involved is not one-to-one, drag from the "one" table to the "many". A window appears with settings.
- In the
**Cardinality**list, click on the option the represents the cardinality of the table relationship. - In the
**Filter direction**list, click on option you prefer:**To [table]:**[Table] is filtered by the other table in the relationship.**To both tables:**The tables filter each other.

**Note:**This setting applies to SSAS Tabular endpoints only.

To add a new relation item to an existing relation

- Drag a field from one table on the model to field on another table and click on the existing relation in the menu that appears.

#### Changing the Default Relation

You can have multiple relations between two tables. The first one will be designated as the default relation, which are necessary in some endpoints.

To set a relation as the default relation

- Right click the relation and click
**Set as default relation**.

#### Changing a Relation's Cardinality

**Note:** This setting applies to SSAS Tabular and Tableau endpoints only.

Each relation has cardinality. In the tree, the cardinality can be identified on the relation items as follows:

**--**: One to one**-<**: One to Many**>-**: Many to one

To change the cardinality for a relation

- Right click the relation, click
**Cardinality**and click on the cardinality you want for the relation.

#### Changing a Relation's Filter Direction

**Note:** This setting applies to SSAS Tabular endpoints only.

Each relation also has a filter direction. To change the filter direction

- Right click on the relation, click on
**Filter Direction**and click on the filter direction you want to set for the table.

## 1 Comments