COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jmills on 13 Jul 2012 01:05:58 PM

Title: aggregation frustration
Post by: jmills on 13 Jul 2012 01:05:58 PM
Hi All,

I'm calculating a Net Amount field, based on Total Amounts from my summary row in a list report by Employee. 

I'm able to properly calculate the net amount, however when I try to aggregate/summarize, I run into the following issue.

for example:
Employee A  Employee B
Net Amount  Net Amount
1000            2000
1000            2000
1000            2000
1000            2000
4000            8000
what i'd like to do is total each employee's DISTINCT net amount (Emp A $1000, Emp B $2000)
and afterwards, include a summary row of $3000.

I've tried averaging each Employee, however the total Summary should be Total, and not Avg.  Any suggestions?
Title: Re: aggregation frustration
Post by: blom0344 on 13 Jul 2012 01:56:09 PM
total(distinct [amount])
or

total(distinct [amount] for [employee])

in the list summary
Title: Re: aggregation frustration
Post by: jmills on 13 Jul 2012 02:18:11 PM
Thanks Blom, however your solution only answers the first part of my dilemma. 

I'm now able to get each distinct Summary amount by employee per below, however when I try to summarize my amounts, it summarizes my entire column, and not just the totals by employee.

Emp A 4000
Emp A 4000
SUMMARY Emp A  4000
Emp B  8000
Emp B  8000
SUMMARY Emp B  8000
TOTAL SUMMARY 24000
Title: Re: aggregation frustration
Post by: blom0344 on 13 Jul 2012 02:34:08 PM
Does it?  Well, the idea is to point in the right direction   ;)  The total summary shouldn't be too hard to find out . Just check the help on performing an aggregate using a context and you will get the last part on your own   ::)