Product How-To: Creating a Logical Model
A logical model is constructed on top of the physical view. The logical model reorganizes the physical view by mapping database tables into ‘Entities’ and table columns into ‘Attributes’, exposing the data in a structure that is familiar to users. Entities group related business attributes together regardless of the attributes’ locations in the underlying physical view (database tables).
This is not simply “regrouping.” The logical model actually denormalizes the database, adding redundancy needed to maximize simplicity for data analysts and end users.
There are two modes for editing logical models. The first mode is ‘Edit Model,’ which is used to create and edit the entities. The second mode is ‘Edit Properties,’ which is used to edit the attribute properties inside entities. You can switch between modes by using the radio buttons at the top of the editing area.
1. In the data source tree in the center pane, select the ‘Data Model’. Then click the ‘Add Logical Model’ button in the toolbar. This opens the ‘Logical Model Wizard’.
2. In the ‘Logical Model Wizard’ enter “SampleModel” into the ‘Name’ field. Click ‘Next’.
3. In the ‘Physical View’ drop-down list, select ‘SampleView’, and click ‘Finish’.
4. Click the ‘Edit Properties’ button at the top of the panel, and then select the Model tab at the bottom.
5. Click the ‘Add New Entity’ button, enter “Order” into the ‘Name’ field, then click ‘Finish’.
6. Now, select the ‘Edit Model’ button and expand ‘SA.ORDER_DETAILS’, ‘SA.ORDERS’, and ‘SA.PRODUCTS’ in the Physical View.
- Entities contain attributes, which map to single columns in the database. To add an attribute to an entity, drag the column from the tree on the left and drop it on the parent entity.
7. From the tree in the center pane, drag and drop the following columns onto the new ‘Order’ entity in the right pane:
- From the ‘ORDER_DETAILS’ table, drag ‘ORDER_ID’ and ‘QUANTITY’.
- From the ‘ORDERS’ table, drag ‘CUSTOMER_ID’, ‘ORDER_DATE’ and ‘PAID’.
- From the ‘PRODUCTS’ table, drag ‘CATEGORY_ID’, ‘PRICE’, and ‘PRODUCT_NAME’.
To sort the attributes within an entity, rightclick on the entity name and select ‘Sort Attributes’. In the Physical View, you can sort entities by using the arrow buttons above the ‘Physical View’ editing pane.
8. ‘Save’ the logical model.