Sum unique item on group

Hi,

I want a sum of the rows I have but only the unique items, for example

Client Name            Amount

Client 1                   $10

Client 2                   $20

Client 2                   $20

Client 3                   $30

Client 4                   $40

Client 4                   $40

Client 4                   $40

I want the sum of this to be Client 1 + Client 2 + Client 3 + Client 4 which is $100. But if I just do a sum it adds up each row. I also have them grouped together, so when it's shown, I only seen one of each item, but a sum still grabs all the duplicates.

How can I go about getting the unique sum

July 26th, 2015 2:16pm

Hi,

You can refer the link- Distinct Sum of detail rows in SSRS for the solution of your problem.

Rachit

Free Windows Admin Tool Kit Click here and download it now
July 26th, 2015 2:27pm

select sum(Amount) as TotalAmount

from (select distinct Client, Amount) X

July 26th, 2015 2:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics