IBM Cognos Analytics Tutorial

Map

In this article, we will learn How to use Maps in IBM Cognos Analytics? To understand the concept of Maps we will create a report of World Populations. On click on any country, we will drill through to state report. Following is the Final Output for Report.

First, we need data. Download following excel file.

FileDownload
WorldPopulation.xlsxLogin to Download
FileDownload
IndiaPopulation.xlsxLogin to Download
FileDownload
CityPopulation.xlsxLogin to Download

In our Excel file, we are using three different sheets. The first sheet is for World population for the year 2018. On the second sheet, we have some dummy data for the Indian States and union territory data. In the last and the third sheet, we have population data for some Cities of Madhya Pradesh State. All the data are the dummy data and only for testing and clearing concepts. Population figures on the first sheet are not matching with the figures on the second sheet. Second sheet data are not matching with the third sheet data. For creating our report, we need to first upload it to IBM Cognos Analytics. First, upload World Population Data.

Next, upload India and City Population Excel. We have our required source data. We will use it for our new Data Module.

Create Data Module

Our data is ready. Next, we will create a new Data Module. Create a new Data Module, select all three files as a source. For City data change the properties for Lat and Lon. Make Lat and Lon to an identifier. We don't need to perform any aggregation on Lat and Lon. Change the aggregation type to none. Also, change the Represents type as a Geographic Location.  Select Latitude for Lat column and Longitude for Lon column. If required you can rename the columns.

Relationship

We have data for World, India and City. We need to create a relationship between each excel file. Create one-to-many relationships between World and India using the columns ID and CountryID. Create another one-to-many relationship between India and City using the columns ID and StateID.
To create a relationship click on diagram icon. Right click on "World Population Xlsx" and select Create Relation. Inside new dialogue in Table2 selects India Population Xlsx. Create one-to-many relationships between ID and Country ID Column. Select ID for World Population Xlsx and CountryID for India Population Xlsx, then click on Match selected columns.

Also create relationships between "India Population Xlsx" and "City Population Xlsx".

Save the data module with name "World Population". Our data module is ready to use. Next we will create a City Report.

Create Report

City Report

First, we will create a report for City data. Follow the steps to create a new report

  • Create a new report. 
  • From templates, select 2 Columns.
  • Optional, If you want to select a theme feel free select one.
  • Select data source World Population data module. 
  • On the left cell add a Map. Now for map we have multiple options to link our data.
    1. First option we can directly add location name and our business measure. With this option, if IBM Cognos Analytics is able to understand the location it will display it on the map.
    2. Second, we have the option to share the location Latitude and Longitude. The IBM Cognos Analytics display measures based on the provided Latitude and Longitude. Now for this we have again two options for Latitude and Longitude format. Latitude and Longitude in a single column or Latitude and Longitude on separate column.
  • For map, select Latitude/Longitude option. 
    • Link Latitude and longitude column. 
    • For label, select Name and for Size or Color use Population. 
  • On the right cell create a List by Name and Population only. Use the query generated for Map. 
  • In Header cell add appropriate header text. 
  • Go to report query and add an optional filter for State ID "[C].[World_Population].[CityPopulation_xlsx].[StateID]=?pStateID?"
  • Our Report for City is Ready.
  • Rename all the elements.
  • Save the report as City Population.

In the city report, we used Latitude and Longitude option. We will use the first option for our Country Report. Following is the Download URL for report.

FileDownload
City population Report.txtLogin to Download

Our first report is ready. Next, we will create a Country Report. Follow the steps to create a new report

  • Create a new report. 
  • From templates, select 2 Columns.
  • Optional, If you want to select a theme, feel free to select one.
  • Select data source World Population data module. 
  • On the left cell add a Map.
  • For map location, use "State or Union Territory" column. For the colors use "Population 2018" column.
  • On the right cell create a List by “State” and Population only. Use the query generated for Map. 
  • In Header cell add appropriate header text. 
  • Go to report query and add an optional filter for Country ID "[C].[World_Population].[WorldPopulation_xlsx].[Country]=?pCounty?"
  • For the Drill-Through click on State column and select "Drill-Through Definitions...".
  • In Drill Through Definition dialog create a new Drill Through Definition with the following properties.
    • Report: City Population Report
    • Action: Default
    • Format: Default
    • Parameters: pStateID
      • Method Pass data Item Value
      • Value: ID. In case ID is missing, you haven't added the ID column. Add it and try again.
  • Save the Drill-Through Definition.
  • Our Report for Country is Ready.
  • Rename all the elements.
  • Save the report as Country Report.

Following is the Download URL for report.

FileDownload
Country Report.txtLogin to Download

Add a Map to a Dashboard

In the last two examples, we worked with for Cognos Reports. In this example, we will add Maps on Cognos Dashboards. Follow below steps to add a map in Cognos Dashboards.

  • Create a new Dashboard.
  • Select an appropriate layout for your Dashboard. We need to add a header and Map.
  • Select World Population Dashboard as the Source.
  • Next on the top section, add a text.
  • In the main section, add a Map with following properties.
  • Next, we need to add a Drill Through from Dashboard to Country Report. For the Drill Through select the map.

We are done with Dashboard. Save it and Run it. Following video shows the final output for the report.

...

About The Author

Hello, I am Mayank Sanghvi I am primarily a BI developer with experience in MSBI and Cognos BI Suit. Also having interest in various other technologies such as Android, Java, C#, ASP .NET and other. I enjoy learning new technologies and share my experience with others.

0 Comments
Leave A Comment

Please login to post your valuable comments.

add