Totals in Table
I have a simple table grouped on Line of Business. I have a totals column which is basically, =sum(Fields!DeviceCount.Value LOB COUNT PCT IT 2948 CLAIMS 2345 TOTALS 5293 The last column in a percentage. I want the percentage of each row calculated. I am stumped. Thanks
August 31st, 2011 8:59am

Hi! If I understand you correctly, you want to calculate the percentage of Count / Totals. In your data: IT 2948 %55.7 CLAIMS 2345 %44.3 TOTALS 5293 Correct? If so, Here's what I would do: sql> select lob, value from my_table IT, 2948 CLAIMS, 5293 Then: On your design palette, create a table. By default this will create a 3-column table. Drag LOB, value into the table, on columns 1 and 2. Leave column 3 blank for now. Click anywhere on your table. You will see a grey border. Go down to the Row Groups section and right-click Row-Groups, probably labeled something like =Details In the popup, select Add Total --> After. This will automatically compute a total for value In your table, you will see the Total row with the value [Sum(value)]. Right-click in this cell and select Text Box Properties In the Name box, change the name to anything you want, such as TotalValue Now, click on column 3, and select Text Box Properties. In the Value field, click on Fx and type the following expression: = Fields!lob.Value / ReportItems!TotalValue.Value. Click OK Finally, in the Number section, change the property to percentage. Done! To pretty things up a bit, you will want to change the column header of the value column to Count. I don't think you can use Count as an actual column name in SQL because it's a reserved word, but you can certainly change it in your report. The trick here is to use ReportItems!TotalValue.Value to reference a specific cell in your report. I hope this helps.DJAnsc
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2011 5:21pm

I don't believe I have that option in VS 2005.
August 31st, 2011 9:12pm

However, I used your logic by using the Name property, that is what I was missing. Thank you so much.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2011 9:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics