Thursday 27 November 2014

How to use Rank function in Cognos Report Studio?

There will be scenario when you need to display Top records in your Cognos report.It could be any fact measure over which you have to find out Top 10 or 20 records subject of requirement.
As Cognos reports data extraction mechanism using SQL query to interact with data base so we must adhere with SQL logic while applying this.There is number of ways to achieve this like using rank or rownumber function.

The above image is for your reference to locate rank within the function tab.

How it works it ranks all fact measure as comparing their value and highest one get rank one and rest of them accordingly.
For example:-
Country
Amount
rank
X
1000
1
Y
400
3
Z
600
2

Only thing which needs to keep in mind always while applying rank and filtering them to certain number like Top 10 or 20 you have to change the properties in detail filter.


Under general you can see Application by default defined as Before Auto Aggregation it should change to After Auto Aggregation.
If it will not change your rank filter will give you inappropriate result.
In case you have any question please write back to us, I will revert you back

0 comments:

Post a Comment