Dimensional model
So far, you have created a fairly straightforward report. You can also create a report that allows the reader to drill up and drill down, to view different levels of detail for the data, within a predefined hierarchy. For that, you need a dimensional or dimensionally modeled data source.
Using the two tables that you have created in the Extract, transform, and load from the staging to the warehouse schema section, you will change the metadata model in Framework Manager to turn it into a dimensional model. However, with only those two tables, there will not be an ideal hierarchy (such as, for example, "Year – Month – Week – Day"), but the steps shown are still relevant to modeling hierarchies.
Figure 31 shows the sample report that you will create in this section, which enables drilling up and down.
Figure 31. Sample drill up/down-enabled report
As shown in Figure 31, the report is a cross tab that shows the number of defects opened by project and project status. You can drill down within the project or project state to see more details.
The types of dimensions with which you can work in the Cognos Framework Manager are regular dimensions and measure dimensions.
A regular dimension contains descriptive and business key information and organizes the information in a hierarchy, forming increasing levels of detail.
A measure dimension is a collection of facts.
For this example, you will start with the metadata model in Framework Manager that you created by using Method 2 (generating the metadata from the database tables) in section Method 2: Model data from the database.
- Create a new namespace called
Dimensions. - In the Dimensions namespace
- Create a Measure Dimension named
SCOPE_HEALTH.- Right-click the Dimensions namespace and select Create > Measure Dimension.
- In the Dimension Definition window that appears, select the SCOPE_HEALTH query subject in the Import View from the Model Objects pane, and drag it to the Measure pane.
- Click OK.
- Create a Regular Dimension named
PROJECT_DIM.- Right-click the Dimensions namespace and select Create > Regular Dimension.
- Drag [Import View].PROJECT_DIM.PROJECT_ID from the Available items pane to the Hierarchies pane.
- In the Hierarchies pane, rename all occurrences of PROJECT_ID with
PROJECT_DIM. - In the Hierarchies pane, select the last level. You should see in the pane underneath that PROJECT_ID had been given the role of _businessKey. If it has not, then set it to _businessKey.
- Drag [Import View].PROJECT_DIM.NAME into the last level in the Hierarchies pane. A small drop-down menu will ask to specify the role of this item. Select _memberCaption, as shown in Figure 32.
- Create a Measure Dimension named
Figure 32. Framework Manager - Creating dimensions
- Also drag the REFERENCE_NUMBER, CURRENCY, and EXTERNAL_IDENTIFIER fields into the same level, and then specify their roles as No Role. The result is shown in Figure 33.
Figure 33. Framework Manager - PROJECT_DIM
- Click OK.
- Create a second Regular Dimension named
STATE_DIM.- Right-click the Dimensions namespace and select Create > Regular Dimension.
- Drag [Import View].PROJECT_DIM.PROJECT_ID from the Available items pane to the Hierarchies pane.
- In the Hierarchies pane, rename all occurrences of PROJECT_ID to
STATE_DIM. - In the Hierarchies pane, select the last level. You should see in the pane underneath that PROJECT_ID had been given the role of _businessKey.
- If it has not, then set it to _businessKey.
- Drag [Import View].PROJECT_DIM.STATE into the last level in the Hierarchies pane. A small drop-down menu will ask to specify the role of this item. Select _memberCaption. The result is shown in Figure 34.
Figure 34. Framework Manager - STATE_DIM
- Click OK.
- Package and publish the model, using the Publish the package section as a reference.
Figure 35. Framework Manager - Dimensions model
After the dimensional model has been published, Report Studio can make use of the hierarchical information. To create the sample drill up or drill down-enabled report shown in Figure 31:
- Create a new list report that uses the newly published package.
- Drag a Crosstab item from the Toolbox onto the report page.
- As shown in Figure 36, drag the PROJECT_DIM hierarchy from the Dimensions.PROJECT_DIM dimension into the Columns section of the crosstab and select Root members in the menu that appears.
Figure 36. Report Studio - Dragging to Crosstab columns
- Drag the STATE_DIM hierarchy from the Dimensions.STATE_DIM dimension into the Rows section of the crosstab, and select Root members in the menu that appears.
- Drag the Dimensions.SCOPE_HEALTH.DEFECT_PENDING field into the Measure section of the crosstab (see Figure 37).
Figure 37. Report Studio - Dragging to Crosstab measures
- Go to Data > Drill Behavior.
- In the Basic tab, check the check box for Allow drill-up and drill-down.
- Click OK.
- Run the report.
In the report, notice that the crosstab headings behave like links. You can explore further in either of these ways:
- Click the crosstab headings to drill down.
- Right-click the crosstab headings and use the context menu to specify drilling up or drilling down.





