Tuesday, January 17, 2012

Determinants Explained with Example

Granularity is a simple concept describing the level data relates to.
Imagine sales areas:


Level1: Country
Level2: Sales Area
Level3: State
Level4: City
Level5: Store
Level6: Department
Level7: Employee


We can summarise sales volume (quantity) at each of the levels above.
The level at which we report is the grain (or granularity) of the table.


Tables or query subjects in Framework Manager often have multiple levels (grains) which you may have to join to another table with a different level grain.


An example of this is budgets.
Using our example above, we want to join our sales area table to our budgets table.
Unfortunately the grain of the sales area table is employee but the budgets have been completed at Store level.

In Framework Manager, if we join directly from store in sales areas to store in the budget data the budget data value will be repeated for how many employees are part of that store.
New Query Subject (join on Store with no determinants set):
Sales Area.City
Sales Area.Store
Budget.Month
Budget.Sales_Target

Result:
As there are four employees at the Bayside store this forces the model query subject to return four rows repeating the sales budget.

To correct this Framework Manager has to be instructed what level of granularity the budget applies to. This is done using determinants.

In our example we need to set the determinants on the Sales Area query subject.
Right click the query subject and select the determinants tab.

One determinant should be created for each level of granularity as shown below.
Create the determinant by clicking Add.

Rename the determinant and then drag the identifying column (Key) into the key window (bottom left). If the level has any attributes that exist at the same level of granularity these should be added to the Attribute window.

If the new determinant you have created is the lowest level grain (Employee in this case) the Uniquely Identified check box should be ticked.
The Group By tickbox should be ticked if the level is ever to be used for aggregating values.

Ensure that once you have created all of your determinants for the query subject that they are in the correct order (use the up and down buttons to sort them correctly).




After setting the determinants click OK to save the changes.


When the model query subject is now run, only one row of data is returned:





Thursday, November 17, 2011

Configuring Cognos 8.4 with Apache 2.2 Module Gateway


Most Cognos systems are set up to run the standard Cognos CGI gateway but Cognos also comes with Apache module which can give more  performance through the Apache web server.

Unfortunately the instructions provided by IBM to set up this module are not enough to configure apache module instead of the standard cgi.

First Install Apache 2.2

We need to make  a few additions to the Apache configuration file `httpd.conf`.

open `httpd.conf`. in wordpad (you can open it start->programs->apache)

at the end of the file,  go the new line and  enter the following command to load the Cognos Apache 2.2 module

LoadModule cognos_module "C:/Program Files/cognos/c8/cgi-bin/mod2_2_cognos.dll"

Then  add the following settings for virtual directories and security.

# Set some directory aliases and security settings

ScriptAlias /cognos8/cgi-bin "C:/Program Files /Cognos/c8/cgi-bin"
Alias /cognos8 "C:/Program Files (x86)/Cognos/c8/webcontent"
<Directory "C:/Program Files (x86)/Cognos/c8/webcontent">
   Options Indexes MultiViews
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
</Directory>

<Directory "C:/Program Files/Cognos/c8/cgi-bin">
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
</Directory>

Alias /Documentation "C:/Program Files/Cognos/c8/documentation"

<Directory "C:/Program Files (x86)/Cognos/c8/documentation">    
                Options Indexes MultiViews
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
</Directory>
 
(Optional Settings start)

Continuing with the same file, add settings for gateway diagnostics and the user directory like so...

# Enable the gateway diagnostics
 <Location /cognos8/cgi-bin/mod2_2_cognos.dll>
                SetHandler cognos-handler
                Order allow,deny
                Allow from all
</Location>

# Configure the user directory
 <IfModule mod2_2_cognos.c>
                CGIBinDir "C:/Program Files (x86)/Cognos/c8/cgi-bin"
 </IfModule>

(Optional Settings end)

  • Now save the file ….
  • restart Apache.
  • open Cognos Configuration
  • Click Enivronment in the leftpane
      in the right pane, change the  end of the `Gateway URI` from ...
     ....cgi-bin/cognos.cgi  to....  ....cgi-bin/mod2_2_cognos.dll

Restart the cognos services.. and use the following kind of URL to start cognos HOME page

http://servername/cognos8/cgi-bin/mod2_2_cognos.dll

Enjoy with this Technique