COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 15 Jun 2017 12:25:51 PM

Title: (Relational) My PCT Caclulation and Error Related to Aggreg.Func
Post by: gosoccer on 15 Jun 2017 12:25:51 PM
Hi, :)PLS HELP!!

Please help if you can, I have to deploy to PROD today.

I'm getting an error on the following,
When verifying the Percentage Data Item, I get the below error since [Sold] has an Aggr. Func on it.

See below,

ERROR:
UDA-SQL-0213 The data type of an argument to an aggregate function is invalid.RSV-SRV-0042 Trace back:RSReportService.cpp(725): QFException: CCL_CAUGHT:

Data Items:

Percentage Data Item:
count(distinct[Sold] ) / total(count(distinct [Not Sold]+[Repaired]+[Restored]) for report)
Aggr Func: Automatic
Roll up Aggr. : Automatic

[Sold], [Repaired], [ Restored] looks like below
case when [TYPE] =1  and [STATUS]  in (1,2,3) THEN  [TRANS_ID] end

Aggr Func: COUNT DISTINCT
Roll up Aggr. : TOTAL

Thanks for your time. :)
Title: Re: (Relational) My PCT Caclulation and Error Related to Aggreg.Func
Post by: Drisya on 16 Jun 2017 01:01:17 AM
Since you have already taken distinct count for [Sold], [Repaired], [ Restored] the following should work.

[Sold]/( [Sold]+[Repaired]+[ Restored])