Monday, May 2, 2016

Cognos Framework Manager Design Best Practices - 1

This proven design is based on using a data warehouse as the data source. 4 Layers are implemented as namespaces in Framework Manager as follows:

Database Layer:
A replica of the source database. Use the Metadata Import wizard to get tables into this namespace.
Do not meddle with the data source queries created by the import as this will adversely affect query performance for end users.
The other tasks that need to be done in this layer are:
a. Set usage correctly – “identity” for surrogate keys, “fact” for sumable numbers, otherwise set to “attribute”.
b. Create 1:N relationship from each dim to fact. I prefer to do this manually rather than allow the Metadata Import wizard to do it incorrectly. Only inner joins, not outer joins!!!
c. Add Determinants on dimensions only, no determines on facts. Top down approach – group by from the top down to unique for surrogate key at the bottom.

Modelling Layer:
Here we create queries that reference data source queries from the Database layer. At a minimum, create identical query subject in the Modelling layer for each data source query in the Database layer. You can also rename queries and its items to your hearts content. If you’ve got a well designed data warehouse as the data source you should not have to rename all the items. The one thing I do is take out the word “Dim” and “Fact” from the query subject names to make them more user friendly.
Relationships are duplicated/recreated in this layer from the Database layer. If sub dimensions or sub facts queries are created then additional relationships need to be added that do not exist in the Database layer.
Other tasks you can do in this layer
a. business calculations eg gross margin, gross margin %
b. amounts in standard currencies
c. folders inside query subjects to organise query items rather than just seeing a big long list of item
d. hide items eg surrogate keys
e. set default formats for numbers and dates

DMR Layer (Optional):
This is where we create multi-dimensional ROLAP cubes containing dimension hierarchies and measures.

Presentation Layer:
Contains star schema groups (right click on each fact in the Modelling layer and and each measures dimension in the Dimensional layer to create and cut and paste into this layer).
Optionally, create namespaces or folders to separate relational objects from dimensional objects. I like to create two namespaces, “Query” and “Analysis”. Query is for the SQL fact based star schema groups and Analysis is for the Dimensional star schema groups

Governor Settings in Cognos

Governor Settings in Cognos:

Governor settings are used to reduce system resource requirements and improve performance. You set governors before you create packages to ensure the metadata in the package contains the specified limits. All packages that are subsequently published will use the new settings. There are a number of governors that you can set. Governor settings in the model can be overridden by governor settings in Report Studio

For Example,

Report Table Limits - You can control the number of tables that a user can retrieve in a query or report

Data Retrieval Limits - You can control the number of rows that are returned in a query or report

Query Execution Time Limits - You can limit the time that a query can take 

Large Text Items Limit - You can control the character length of BLOBS (binary large objects) that a user can retrieve in a query or report

Allow Enhanced Model Portability at Run Time - You can use a separate but structurally similar data source at run time. The database schema must be the same between the two data sources.

Allows Usage of Local Cache - Select this governor to specify that all reports based on this model should use cached data.

Outer Joins - You can control whether outer joins can be used in your  query or report.

Cross-Product Joins - You can control whether cross-product joins can be used in your query or report.

Use With Clause When Generating SQL - You can choose to use the With clause with Cognos SQL if your data source supports the With clause.

Suppress Null Values for Dimensional Data Sources - This governor is supported for SAP BW data sources only. It does not work with relational or OLAP data sources.