COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: charon on 06 Jan 2012 02:47:27 AM

Title: [solved] Rank-function does not work properly
Post by: charon on 06 Jan 2012 02:47:27 AM
Hi Community,

im fighting with a small issue in C10.1.1 Report Studio. My Rank does not work properly, and i have no clue what im overseing. The idea is, to rank Data (e.g. for revenue) and get a top 10, esp. in a chart

I have created a new data item in that query with that syntax
rank ([Database].[Fact]DESC for [Database].[company] )
After that, i created a filter giving out only the ranks smaller 11 [rank]<=10...ut it does not work. In the chart, the data is still not ordered by rank nor are there given only the top 10 but all members.

Any ideas or clues what i am not seeing?!
thx a lot  ;D

cheerz :p

Title: Re: Rank-function does not work properly
Post by: HalfBloodPrince on 06 Jan 2012 03:07:11 AM
Try this
For eg. to retrieve top five unit prices sort unit price column descending and use function as
rank([Unit sale price] at [Product name]) in a query calculation with name Top five
then go to Query tab in summary filters add filter as Top five < 5
Title: Re: Rank-function does not work properly
Post by: charon on 06 Jan 2012 03:22:51 AM
Thx for ur reply  8)
#Dont get me wrong, but where is the difference to what i did? Or did i misunderstand your approach?

1) sort
2) data item/ query calc. with rank sql statement
3) filter

:o maybe i havent slept enough, but i dont see it..
sry  :P
Title: Re: Rank-function does not work properly
Post by: CognosPaul on 06 Jan 2012 03:23:24 AM
Did you remember to set the filter to after auto-aggregation?
Title: Re: Rank-function does not work properly
Post by: HalfBloodPrince on 06 Jan 2012 04:15:25 AM
Add summary filters 
Title: Re: Rank-function does not work properly
Post by: charon on 06 Jan 2012 05:07:42 AM
hmhm...

good advises, in fact i DID forgot to change the auto agreggation mode...
BUT: even after changein to "after aut...." the result is still not the expected one.
2 explanation imao:
1) the nub me is overseing sth. RLY simple (quiote possible ;)
2) might be query or even an etl issue, cause im getting some other strange results in that query

Il check after break again...thx so long for ur help
cheerz :p
Title: [solved] Re: Rank-function does not work properly
Post by: charon on 06 Jan 2012 09:33:08 AM
hi prince and paul,

just played a bit and found out that
- creating an data item with only the pure rank function
rank([db].[productline]DESC) without the for attribute (rank...for [db].[revenue]) does it (in combination with the filter for the top 10 ranks ([rank]<=10) in after aggregation mode, ty paul ;)
AFTer i deleted/ modified some other filters created from the 2 prompt pages at the start.

also, i think the fact that there are relational and dimensional modelled data in the package is not optimal  :o
last but not least, there are a lot of filters and dprompts in the queries related to this query (and in the report in general) which make it quite complex and hard 2 modifiy.

but it works now, and i can enjoy my weekend  ;D
ty all for replying and have a nice weekend as well,

cheerz charon  :P


Title: Re: Rank-function does not work properly
Post by: bbtresoo on 04 Nov 2014 04:42:52 PM
Hi guys,

In my list, I have two similars amount which come up with the same rank ( :Dnormal). How can I force the distinction between these amounts knowing that I'm listing amount for securities ID,  in a nutshell I'm looking for another selection criteria

I have in my list securities ID(varchar), securities desc(varchar), Market value(number)
Title: Re: [solved] Rank-function does not work properly
Post by: bbtresoo on 12 Feb 2015 11:04:16 AM
hi guys

there's something giving me headache as hell, hope you can help me on this.

I have a data item rank working fine, Rank ([Amount]) in  query1. everything went bad when I changed it to Rank ([Amount] at [class]).

I have list 1 and chart 1 based on the same query 1. the data item Rank works fine in the list1 and not in the chart1. it looks like the problem is definitevely the 'at [class]' I added.
the rank have been dragged and drop in categories (y-axis) section.

Here is the message error I get when I run the report The for-clause of the inner aggregate 'total' must be a superset of the union of the at-clause and for-clause of the outer aggregate 'rank'.

the message isn't really self explanotory for me. Thank you for your help.