Reports with complex repeated expressions within groups - ideal candidate for variables but you can't aggregate them!?

Hi all,
Given this:
date
(rowgroup)
categories (colGroup)
Total (forCategories)
some Percent
Result
Result With%
Total of Result And Other Things here
cat1
cat2
cat3...
1st
[ val
val
val]
Sum(Value)
Max(%)
Tot*reportVar+3300
Result*1+Max(perc)
result + resultWith% (NOTE:this is total from last two cells)
2nd
3rd
Totals
Total
Total
total
total
rowGroup by date
colGroup by category
there are some "REPORT" variables that do things like "total" for a dataset that is to be shown on the report and used in some calcs...
So now that I've (hopefully) set the scene...
Aside from the apparent BUG in vs2012 where you can't see or get intellisense on "Group Level" variables - which is REALLY tough when you aren't that familiar with variables I must say!! - variables seem like they would solve my problem.
But if I use report variables in the row level I get the "cannot be used in aggregates" when I try to "Add Total" which is annoying but I'll accept that as a limitation, but surely this can't be the first time someone has wanted
to achieve the above in a report!!
So what is the solution, there must be one...
While I know SSRS is NOT Excel its really surprising and annoying when something so simple like summing the last two fields is nearly impossible and I can't see WHY it should be so frustrating that I have to have complex formula repeated in several
cells... particularly when I get the formula wrong and then have to remember to CHANGE it in several different places?!
Is SSRS simply not the right tool for reports where you need to be able to see and follow calculated series and I should be encouraging the business areas to extract data into Excel spreadsheets with some kind of template setup or am I missing something
really obvious about SSRS that would stop me from pulling all my hair out...?

Hi noJedi,
If I understand correctly, you want to sum total values of the last three columns. In this situation, we can use custom code to work around the issue. Please refer to the custom code below to work around the issue:
Public Shared Value as Decimal=0
   Public Shared Function GetValue(Item as Decimal) as Decimal
      Value= value + Item
      Return Item
   End Function
   Public Shared Function GetTotal()
      Return value
   End Function
Then use the expression below to calculate the multiplication result:
=Code.GetValue(Calculate Expression)
And use the following expression to calculate the sum value:
=Code.GetTotal()
Since you need to calculate three columns total values, we need modify the code repeat three times to get the values for each columns.
There is a similar issue, you can refer to it.
http://social.technet.microsoft.com/Forums/en-US/2084ef24-76d0-47c3-964a-340278d998c0/ssrs-2008-custom-code-to-properly-calculate-sums?forum=sqlreportingservices
If there are any misunderstanding, please feel free to let me know.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support

Similar Messages

Maybe you are looking for