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
 sum a group except one filed

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2009-10-20 : 17:58:05
So in my grouping im doing a sum an a all my fields. I need to show these fields but in the sum of the i need to not include those numbers. Is that possible?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-10-20 : 18:31:08
Your question is not clear. Show us the query and a data example.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

gavakie
Posting Yak Master

221 Posts

Posted - 2009-10-21 : 10:43:15
i have a grouping of items say, sales by a description so
sale1 $$$$$
sale2 $$$$$
sale3 $$$$$
sale4 $$$$$

In the footer I have a sum of those sales i want that sum minus say sale4
Go to Top of Page

mchohan
Starting Member

39 Posts

Posted - 2009-10-23 : 06:38:22
Why don't you exclude it in your sql Where clause?

Mitesh
www.toastbox.co.uk
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-23 : 14:30:16
quote:
Originally posted by gavakie

i have a grouping of items say, sales by a description so
sale1 $$$$$
sale2 $$$$$
sale3 $$$$$
sale4 $$$$$

In the footer I have a sum of those sales i want that sum minus say sale4


use expression as

=iif(fields!description.value="sale4",0,fields!sale.value)
Go to Top of Page

gavakie
Posting Yak Master

221 Posts

Posted - 2009-10-27 : 09:40:13
Something like this works fine.

=SUM(IIF(Fields!Letter.Value="Sales",0,Fields!Mailed.Value))

but in some fields I have calculated sum. Can I do anything with that?

=SUM(IIF(Fields!Letter.Value="Sales",0,IIF((Fields!ROs.Value) = 0,0,(Fields!ROs.Value)/(Fields!Distinct_Customers_Contacted.Value))))
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-27 : 14:03:40
yup. you can access them using Reportitems!textbox.value
Go to Top of Page
   

- Advertisement -