COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sanchoniathon on 27 May 2009 11:04:34 AM

Title: Error message when using rank function ?
Post by: sanchoniathon on 27 May 2009 11:04:34 AM
Hi to all,

- We have a simple list report with only 4 columns
- One of the columns (the last one from the left) is named "Rank" and is based on one of the columns (measure)
- The code inside this column is as follows: rank([Number of Pieces])
- we are using Report Studio 8.4 against a package coming from a BW cube
- When validating the report i get the following error message:
  RQP-DEF-0585 The expression, 'rank([Number of pieces] desc auto )', is too complex for carrying over the attributes
  (format, currency and unit of measure). Column attributes are only retained for expressions with just 2-part item references.


Anyone has an idea why ? Or any suggestions ?

When in the expression editor, i noticed that there is 2 diff. rank functions available from the "Functions" tab of the "Available components"
I can only use one of the 2 rank functions because the other one has a exclamation mark next to it.

Thanks in advance !
Title: Re: Error message when using rank function ?
Post by: DustPanMan on 27 May 2009 11:11:33 AM
Try to change the solve order for Rank to something like 10.  If that does not work, it sounds like [Number of Pieces] may be defined as an attribute instead of as a fact.  If this is the case, you'll need to make a model change or convert number of pieces to a number within Report Studio.
Title: Re: Error message when using rank function ?
Post by: sanchoniathon on 27 May 2009 01:09:35 PM
Hi DustPanMan,

1- I tried to apply a "Solve Order" of 10 to the metric [Number of Pieces] but with no luck. Still same error message.

2- How do i know if the metric [Number of pieces] is defined as an "attribute" and not a "fact" ? I dont' have access to FrameWork Manager.
The values of this metric have the letters pc for pieces after the number:
156PC
  37PC
I mean it is not only a number from what i can see.

Any suggestions before i demand to the BW team to deploy another modified package from their cube ? Because this demand could take 5-6 days ...
I can still TRY to convert my metric to a real number. Any suggestions on this ?

Thanks !
Title: Re: Error message when using rank function ?
Post by: sanchoniathon on 27 May 2009 02:38:14 PM
Hello to all,

I managed to bypass my problem (error message) by using the topCount( ). function instead as for in my case it will do what i whant it to do.

Which is to display the top 10 products only.
No more error message by using the function and everyone is happy ...

Thanks anyhow !
Title: Re: Error message when using rank function ?
Post by: DustPanMan on 27 May 2009 04:45:05 PM
sanchoniathon,

You may be getting different numbers than you think... top count will count the number of values, but not total the numbers.  In order to solve the issue, you'd have to remove the trailing pcs to get just a number and then convert to integer cast([Number of Pieces] as Int).  This will then allow it to aggregate and rank.

Regards,

Dustin
Title: Re: Error message when using rank function ?
Post by: sanchoniathon on 28 May 2009 12:53:11 PM
Dustin,

1- The topCount function is working fine when using a list (4 columns)
2- I need to keep the topCount column as part of the report as it won't work.
    I'm ok with this and it's not a problem for me.
3- BUT the problem is when i convert my report to a crossTab or if i create a new crossTab from those same columns.
4- The topCount doesn't works no more ???

Any ideas why ? I mean if it worked with a list (without even changing the column to an integer) it should also work in a crossTab ?

Thanks for your support !