COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: akhattri on 22 Jan 2009 11:41:04 AM

Title: Sum 2 values in a new Data Item for a single ID
Post by: akhattri on 22 Jan 2009 11:41:04 AM
Hello all,

I am trying to create a calculated Data Item which sums the dollar amount for a single person received in 2 periods, ex. Say Person A has received some money X in the aid period M and Money Y in the aid period N, I want a calculated column which does a sum of X+Y for that person. I tried doing total(Money_Amount for A) but it is not giving the correct results.



Kindly assist.



Thanks





(Output should look like this :

Person Aid_Period Amount Total_Amount for that Person

A             M             X          X+Y

A             N             Y          X+Y
Title: Re: Sum 2 values in a new Data Item for a single ID
Post by: unnava on 22 Jan 2009 10:23:49 PM
hi,
   

   A   M   X     X+Y
   A   N   Y     X+Y

  IN THAT DATA ITEM  TOTAL((X+Y) FOR A)
  X+Y MEANS THE DATA ITEM NAME
  MAY BE THIS FORMULA WORKS
 
Title: Re: Sum 2 values in a new Data Item for a single ID
Post by: akhattri on 23 Jan 2009 09:52:44 AM
I have already tried total([amount] for [ID]) but it is giving me weird numbers and not the sum for those 2 columns.