PMsquare

Services

Blogs

Sonya Fournier, February 6, 2020

Get the Best Solution for
Your Business Today!

Table of Contents

More Power

When Cognos 11.1 was released, it introduced enough new Data Modules features that a realistic case could be made to consider moving from Framework Manager packages to Data Modules for metadata modeling. One of the essential pieces that were missing from earlier releases was the ability to deal with multi-grain issues (as addressed by determinants in Framework Manager).

Without determinants, we can end up with double-counting or incorrect aggregation in our reports and dashboards. Until some sort of feature was added to deal with multi-grain data scenarios, it was impossible to fully move to Data Modules when reporting against a data warehouse.

In Data Modules, we don’t have determinants, which isn’t a bad thing as they were always a bit hard to comprehend as implemented in Framework Manager. Instead, we have something called “column dependencies”. We use column dependencies in a couple of scenarios:

1. When we see multiple fact tables with conformed dimensions joined to dimensions on columns that are at different grains of detail.

As an example, Sales target fact and Sales fact join to conformed dimensions on different fields – Sales target joins on the month field in the Time table, Sales target joins to Products table on Product type, and Sales target joins to Retailers table on Retailer table whereas Sales fact joins on Date, Product, and Retailer site (all at a lower grain of detail).

Cognos Data Modules 1 Sample Fact Table.png
Cognos+Data+Modules+2+Dimensional+Joins.jpg

2. When a table contains data that is pre-aggregated.  

For example, a table that contains pre-summed columns for revenue at the monthly, quarterly, and yearly levels. If we add those pre-summed columns to a report, Cognos is likely to aggregate them again.

Cognos+Data+Modules+3+Presum+Tables.jpg
Cognos+Data+Modules+4+Presum+Tables.jpg

Adding Column Dependencies to Multi-Fact Data Modules 

When tackling the first issue above, we need to add column dependencies to each of the conformed dimensions.  

A closer look

Let’s look at the model first before we add column dependencies. We have the following joins defined:

Cognos Data Modules 5 Model before column dependencies.png

“Products” joins to “Sales Fact” on “Product Key”. This is the lowest grain of detail in the database (the “Atomic Grain” as Kimball would say). 

Cognos Data Modules 6 product joins to sales fact.png

When we look at the relationship between Sales Target and Products, we can see that it joins on a higher grain (Product type key). 

Cognos Data Modules 7 relationship sales target and products.png

This is not the lowest grain in the Products table so we will see repeating values if we include information from both fact tables in our report.  

Here is an example of the data in a report:

Cognos Data Modules 8 data report example.png

In this example, our Sales Target is much higher than our Sales Total. If we add more information to the report, we can see from where these numbers are derived. 

Cognos Data Modules 9 data report added detail.png

Since we don’t have a Sales Target for every product—rather by Product Type—we are seeing the Sales Target repeat for every product. Because Cognos Analytics will sum these values by default, we see incorrect data when we only include Product line, Sales total, and Sales target. Even with more detail, we will see incorrect subtotal values.   

The fix is in

How can we fix this? We can add column dependencies in the data module.  

To do this, we go to each conformed dimension (each dimension that sits between two fact tables) and go to the Column dependencies screen. 

Cognos Data Modules 10 add column dependencies.png

We start here with a clean slate. 

Cognos Data Modules 11 column dependency clean slate.png

From the Products table, we drag over the columns that represent the different groupings of data we have on this query – so on the product table, we have three major levels or groupings of data: product line, product type, and product. 

Cognos Data Modules 12 products table.png

You should choose the key or code columns here whenever possible (or the fields that are used for the joins).  

We need to link these dependencies in order of coarsest grain to most fine. To do this, we start with product line and drag the connection icon on top of product type. Do the same from product type to product. 

Cognos Data Modules 13 link dependency.png

Next you add all of the columns that are at the same grain as your initial columns: 

Cognos Data Modules 14 added similar columns.png

We repeat this process with the other conformed dimensions.  

If we test our report again, here is what we will see: 

Cognos Data Modules 15 report data round two.png

If we add more details: 

Cognos Data Modules 16 additional detail round two.png

You can see the data is still being repeated (the only option since Cognos does not know how that product type sales target could be divided by product) but when we look at the summary column, it is showing the correct value.  

Adding Column Dependencies to Tables with Pre-Aggregated Data 

The second type of column dependency is needed when you have pre-aggregated measures in your table.  

When we are setting up column dependencies in this situation, we will add the measures to the group level to which they are aggregated. For example, we will add Yearly Revenue to the Year column dependency.   

Here is the data module we are working with: 

Cognos Data Modules 17 working data module.png

When we build a report using this data module, we see that both the details for Yearly, Quarterly, and Monthly revenue are incorrect and that the subtotals are also incorrect. In the example below, we should see the same value in the Monthly Revenue column that we see in the Revenue column. 

Cognos Data Modules 18 Report build.png

When we add column dependencies, we start with adding the level groups. 

Cognos Data Modules 19 adding level groups.png

Then we will link each column dependency from coarsest grain to most detailed grain. 

Cognos Data Modules 20 from coarse to detailed grainularity.png

Then we add the measures to the appropriate grain.

Cognos Data Modules 21 adding measures to appropriate grain.png

When we retest the data module in the reporting tool, here is what we see now: 

Cognos Data Modules 22 retest the data module.png

If we add Date to the report, we can see all the values.

Cognos Data Modules 23 add date to report.png

Conclusion

With the addition of column dependencies, it is starting to get easier to see how we can start transitioning from Framework Manager models to Data Modules. Will you start moving new development to Data Modules? Or are you Framework Manager for life? 

Next Steps

We hope you found this article informative. Be sure to subscribe to our newsletter for data and analytics news, updates, and insights delivered directly to your inbox.

If you have any questions or would like PMsquare to provide guidance and support for your analytics solution, contact us today.