If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Top n records

Started by bharath_hsbc, 28 Aug 2007 10:55:25 AM

Previous topic - Next topic

bharath_hsbc

I have a table with marks scored in a subject. I want to show the top 10 students along with their marks. How do i do that in reportnet.

i could assign ranks through running count function but am unable to do rank<11. Any suggestions are appreciated. Thanks. :(

bharath_hsbc

This is funny, am answering my own query. well, i could do it. this is what i did.

go to the query. double click on the name of the item. in my case it is 'Student_Name'. then edit the expression as topcount([Student_Name],10).

The integer 10 can be changed to the number of records to be displayed. Cool, eh ? Please let me know if you r still facing issues.

MFGF

Hi,

If your data is coming from a table via a relational package, the way to go would be to create a Query Calculation using the Rank() function eg
Rank([Mark])
then use this calculated item in a filter eg
[Calculated Item]<11.

If you are using a dimensional package, you should be able to use a query calculation containing the topCount() function eg
topCount([Student],10,[Mark])

Regards,

MF.
Meep!

bharath_hsbc

Thanks MF,

Although my query worked, yours make so much more sense. i learnt something new today thanks to u.

mvbsdeepthi

urgent requirement... plss.....

Hi All,

I have a similar requirement in which I need to display top n countries based on revenue where the value of n is entered during run time.
Any help is appreciated.

CognosPaul

Were you able to successfully use MF's suggestion? Once you get that working it's a simple matter of replacing the number with #prompt('topN','integer')# and using a textbox prompt to capture the number from the user.