Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Unable to use Previous in a Sum aggregate function

$
0
0

I have a report that produces totals based on a offer. Within each offer a single user may have multiple rows. An example is below

Offer  User  Amount  Total

1        1       10         10

1        2         5         10

1        2         5         10

1        3       10         10

In the above example the sum for Total would be 40.00. What I want to do is to have the total for user 2, which has 2 rows, to only be added once so the total would be 30.

This is what I tried to do...

Sum(IIf(Fields!User.Value = Previous(Fields!User.Value), 0, Fields!Amount.Value))

But I receive an error that says "Previous functions cannot be specified as nested aggregates".

Does anyone know of another way to accomplish this? I've tried using variables but there are too many restrictions on those as well.

Thanks




Viewing all articles
Browse latest Browse all 10045

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>