Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 How to calculate subtotals/grand total

Author  Topic 

SSRS_Developer
Starting Member

4 Posts

Posted - 2009-01-09 : 18:57:08
Hello,
I have been trying to calculate subtotal and grand total using report desinger table and list.But no luck.. :O(

I need my final report to look like this

company state product Amount1 Amount2 Amount3
01 CA A 2222 333 444
B 2222 333 222
sub total 4444 666 666

01 CA c 2222 333 444
D 2222 333 222
sub total 4444 666 666
total of subtotal 8888 1332 1332

01 AZ A 2222 333 444
B 2222 333 222
sub total 4444 666 666

01 AZ c 2222 333 444
D 2222 333 222
sub total 4444 666 666
total of subtotal 8888 1332 1332
total 17776 2664 2664

02 CA A 2222 333 444
B 2222 333 222
sub total 4444 666 666

02 CA c 2222 333 444
D 2222 333 222
sub total 4444 666 666
total of subtotal 8888 1332 1332

02 AZ A 2222 333 444
B 2222 333 222
sub total 4444 666 666

02 AZ c 2222 333 444
D 2222 333 222
sub total 4444 666 666
total of subtotal 8888 1332 1332

final grand total

I need to give sub toals for 2 seperate product groups, then add then up for each state and company. I have a colums in a data set in report designer (SQL Server 2005) I have trying to use report desginer to calculate the sub totals using SUM fuction and table footer. I can't get the sub totals in between when I'm using the "group" in report designer where I group it by company, state and product line...

HELP PLEASE!!
IM GOING NUTS thinking and trying to find a solution!!
Thanks in advance~

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-10 : 02:38:27
its very easy in reporting services, all you need to do is to place group footer (its avaialble from grouping properties tab, just click on checkbox). then use =SUM(Fields!Yourfield.value) and it will automatically give you subtotal for each group. For getting grandtotal,place table footer and use same expression, it will give you total of field for entire table.
Go to Top of Page

SSRS_Developer
Starting Member

4 Posts

Posted - 2009-01-14 : 17:38:51
Thanks for the reply. Actually I am aware of what you explained. I am in a dilema about organizing the data in the manner of the final report requirement. I have to get the sub total for product lines and then need to get sub totals for only 1 sub-product line and then toatl the two grouping by states and later on total by company. I know that the footer "SUM" will give the final grand total.
Thanks for the input.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-17 : 02:52:25
no problem in that. if you want total for only one subtotal use expression like

=SUM(IIF (Fields!YourSubtotalFiueld.value="Your reqd subtotal value",Fields!Yourfield.value,0)

instead of simply

=SUM(Fields!Yourfield.value)
Go to Top of Page

jonathanr
Starting Member

11 Posts

Posted - 2009-04-21 : 21:09:49
Hi,

Re " place group footer (its avaialble from grouping properties tab, just click on checkbox). " from visakh16. I cannot see where to find this option. can anyone let me know how I enable this view?

Thanks,

JR
Go to Top of Page

sachya45
Starting Member

25 Posts

Posted - 2009-05-01 : 15:35:02
quote:
Originally posted by jonathanr

Hi,

Re " place group footer (its avaialble from grouping properties tab, just click on checkbox). " from visakh16. I cannot see where to find this option. can anyone let me know how I enable this view?

Thanks,

JR


select table and right click on table , select properties,in properties
select groups, then click edit your group and in grouping and sorting window u will find checkbox at bottom for include group header and footer.
Go to Top of Page
   

- Advertisement -