I have an rdlc report file, and I am trying to make a sum which can only include the last item in each group. I have a table kind of like this:
Place = ? (Group header 1)
User = ? (Group header 2)
Date =Last(Fields!Number.Value) (Group header 3)
Number =Fields!Number.Value (Detail row)
So, in other words, in User
there, I want a sum of Date
... if that made sense...
The Number
rows contain many numbers per Date
. But Date
shows only the last number for that day, because the rest doesn't count (but must be displayed) In User
I want to sum up those last numbers for all the dates for that user. And same with Place
(which would be the sum of every last number for every day for every user).
Could anyone help me with this? I tried the obvious (to me at least) =Sum(Last(Fields!Number.Value))
, but (also tried to specify the group in those functions, but didn't make a difference because) I get an error when I try to compile which says:
The Value expression for the textbox 'numberTextbox' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.
Which I guess kind of makes sense... but how do I do this then?
Update: I have solved the issue by adding another column, and copying those last numbers into that column. This way I can display all the numbers, and do the summing on the column that only contains the ones that is going to be in the sum. I am still very curious to if anyone have a solution to my original problem though... so please post an answer if you do!