COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Cognos8 on 06 Apr 2010 12:02:32 PM

Title: Topcount
Post by: Cognos8 on 06 Apr 2010 12:02:32 PM
I used topcount in c82 like this .... topCount( [Grp] ,10,[Cnt])

after migrating to c84 got the below error..

RSV-VAL-0010 Failed to load the report specification. QE-DEF-0478 Invalid coercion from 'string' to 'memberSet' for '[Grp]' in 'topCount([Grp],10,[Cnt])'.

did follow the below ibm kb ...
http://www-01.ibm.com/support/docview.wss?uid=swg21376464

No luck after applying this.
Title: Re: Topcount
Post by: MFGF on 07 Apr 2010 06:41:15 AM
Hi,

Some of the syntax checking in 8.2/8.3 was a little, um, lax, shall we say?  These builds would allow non-legal syntax - particularly with dimensional type expressions - that should really have been rejected as inappropriate.  The 8.4 release tightened up on this syntax checking, and as a result some folks have been encountering errors like yours when upgrading.

The error tells me that your [Grp] item is not a set of members but instead is a string value - this is where the issue lies.  Can you look at how [Grp] is defined in the report - is it also a query calculation? If so, how is it defined?  If you can post back the current definition, we can probably suggest how to recode it or convert it into a member set and make it all legal again.

Best regards,

MF.
Title: Re: Topcount
Post by: Cognos8 on 08 Apr 2010 06:05:59 AM
[Grp] - Which contains Case statement
Aggregate function  - Automatic
Roll up Aggregate funtion  -Automatic


[Cnt] = count(distinct[nbr])
Aggregate function  - Total
Roll up Aggregate funtion  -Automatic

By combining this two one dataitem is created with expression as

topCount([Grp],10,[Cnt])
Aggregate function  - Total
Roll up Aggregate funtion  -Automatic

Kindly let me know do you need any other information.
Title: Re: Topcount
Post by: MFGF on 08 Apr 2010 06:15:05 AM
Hi,

We need more info on how [Grp] is defined.  What values does the case statement return - individual members/sets of members/levels/attributes/captions/hard-coded strings etc?

To use it in a topCount function, it MUST return a valid member set.  If it's not possible to recode the CASE statement to return this, then we will need to look at manipulating the returned values into a set.  We can't do that unless we know what's already defined, though.

Regards,

MF.
Title: Re: Topcount
Post by: Cognos8 on 08 Apr 2010 06:33:30 AM
Hi ,

Answer for your question..

We need more info on how [Grp] is defined.  What values does the case statement return - individual members/sets of members/levels/attributes/captions/hard-coded strings etc?

Ans - It returns hard coded string or column value.

ex: case when [cmp] in '123' then 'IBM'
else [data item value]
end.
Title: Re: Topcount
Post by: MFGF on 08 Apr 2010 07:17:22 AM
Thanks,

Can you confirm what type of package you are using - either Relational (with Query Subjects and Query Items) or Dimensional (with Dimensions, Hierarchies, Levels, Members, Attributes and Measures)?

TopCount is a Dimensional function, designed to be used with Dimensional packages, and your reference to [data item value] has got me wondering if you're using a Relational package.

Thanks,

MF.
Title: Re: Topcount
Post by: Cognos8 on 08 Apr 2010 09:14:40 AM
it is relational model, In C82 this topcount functions showed as dimensional function (in function pane with exclamation mark) but my report works fine. But when you see funtion pane of  c84 it does not mentioned as dimensinal model function.
Title: Re: Topcount
Post by: MFGF on 08 Apr 2010 10:28:08 AM
Hi,

TopCount() is designed for use as a Dimensional function.  I very much doubt you will get it to work with a relational package in 8.4.

Sorry!

MF.