views:

700

answers:

2

Hi

Reporting Services 2000 SP2

I've got a matrix displaying the number of employees

                 Business1      Business2      Business3
StartBefore99    9              14             4
StartAfter99     30             20             34

I'd like to display percentages eg

                 Business1      Business2      Business3
StartBefore99    9 (23%)        14 (41%)       4 (10%)
StartAfter99     30 (77%)       20  (59%)      34 (90%)

Any suggestions? I could do it in SQL, but would prefer to do an expression in RS.

Cheers

A: 

What you can do is use an expression so for example

= SUM(Fields!StartBefore99.Value) + FORMAT(Sum(Fields!StartBeforeValue99) / Fields!Total.value,2)

Total is a field that you calculate in your data set. It's been a while since I touched RS but this is basically the code I wrote before. You need to do a SUM I believe since its a matrix., If this was just a table it'd be a little bit simpler in that you'd not need to do the summing.

JoshBerke
A: 

Many thanks Josh

Here's what I ended up using

=Sum(Fields!StartBefore99.Value) & " (" & Format( ((Sum(Fields!StartBefore99.Value)/Fields!TotalNumberOfPeopleInPlant.value)*100), "0")  & "%)"

I did a TotalNumberOfPeopleInPlant in the SQL and returned the value with each row.. sometime in future I'll look into doing that bit in RS!

Dave
You could also do a sum() with a larger context and sum the entire recordset yourself, but I'm fuzzy on my RS skills. I also was using SSAS and we ended up doing some of the calculations within the cube which worked as well.
JoshBerke