How do I calculate SUM(DISTINCT field1) - COUNT (field2)?

794 Views Asked by At

I need to calculate RESULT = SUM(DISTINCT field1) - COUNT (field2) for a group in a SSRS 2005 report.

DISTINCT is not allowed in SSRS and if I omit DISTINCT the SUM is too high (I have field2 which occurs multiple times within field1).

1

There are 1 best solutions below

0
On

I know this an old thread, but I hope it help others!

You need to write custom code to apply the aggregate.

For full reference and code please take a look at this post and the answer within the comments section here.