Megosztás a következőn keresztül:


Working with Roles, Source Fields, and Expressions

Entities contain source fields (attributes), roles, folders, and expressions. When you run Model Designer, roles and source fields are automatically created within entities for you. You can add additional fields, roles, folders, or expressions to the entities once the model is created.

Adding a Role

A role indicates that two entities are related to each other. The role can be a 1-to-1 relationship, a 1-to-many relationship or a many-to-many relationship. For example, the Store Location entity has a 1-to-1 relationship with the Address entity; therefore, for every store location, there is a single address. The Customer entity has a 1-to-many relationship with the Sales Orders entity; this means that for every customer there are multiple sales orders.

In addition to the cardinality information, the properties of a role establish how the two entities behave in relation to each other. For example, a lookup role dictates that the identifying attribute of the one entity is the only data that your users can access from the other entity.

Report Builder users can see the relationship between the two entities in the Explorer pane when exploring the data.

Adding Source Fields

A source field is a field that is bound to a column within the database. Typically, it references a single item. For example, Product Name is a source field and it contains the name of each product that a company manufactures. Over time, your database schema will probably change and you will need to add new source fields to the model to reflect the changes in the database.

Adding an Expression

An expression is a field whose value is calculated based on a series of functions, operators, or constants. Typically, it references multiple fields and returns a single value. For example, you could use an expression to display the 2004 sales average for each employee within your company. You might want to create expressions to present the data in your database in different ways, for example combine the contents of the First and Last Name fields to create a new field called Name; or, you might want to create expressions to reflect changes in the database schema.