COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Nandini.t on 06 Feb 2012 01:45:59 AM

Title: aggregation based on two conditions
Post by: Nandini.t on 06 Feb 2012 01:45:59 AM
Hi all...

I have [Insured Amount] ,[Product Code] and [Company Code]
so i have to calculate [Insured amount] with respect to [Product Code] and also for [company Code] .
so how can i write the expression to get related data.
Pl guide me on this.

Many Thanks in advance for any guidens...

Title: Re: aggregation based on two conditions
Post by: blom0344 on 06 Feb 2012 04:12:10 AM
total([Insured_Amount] for [Productcode])

total([Insured_Amount] for [Companycode])
Title: Re: aggregation based on two conditions
Post by: Nandini.t on 06 Feb 2012 04:15:40 AM
Hi blom,
Thanks for the reply.
But here the particular product code must be present in that particular company code right. so can this calculatio help?
Many  thanks,
Title: Re: aggregation based on two conditions
Post by: blom0344 on 06 Feb 2012 08:15:53 AM
Not sure I understand.  If you fetch both companycode and productcode then  Insured_amount will be totalized for the combinations of both companycode and productcode. This will not require any further definition of the calculation.

The totalization with an added context ('for' ) simply enforces that totalization will be defined against just the dataitem in the context.