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
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Selective Summing in Row Group Footer

Author  Topic 

waxdart23
Starting Member

33 Posts

Posted - 2011-06-22 : 04:57:17
I want to have a the sum of my columns in a Row Group footer based on a value within the same row. So I added an expression in the Row Group footer as follows:
=Sum(IIf(Fields!credit_ind.Value = "N", Fields!grecd.Value, 0))

So what I want is the Sum of the field 'GRECD' where the 'CREDIT_IND' field for the row is equal to "N". The 'CREDIT_IND' field can have up to 6 different values but I only want it to sum those where it is "N".

This expression shows an error and I can't find anything else which will work.

Any thoughts?

Thanks
P

waxdart23
Starting Member

33 Posts

Posted - 2011-06-22 : 05:48:14
OK that expression work however it was a datatype issue as GRECD is a decimal/currency field so it didn't like adding it to 0.

Is used:
=Sum(IIf(Fields!credit_ind.Value = "N", Fields!grecd.Value, CDec(0)))

... and this worked fine.

Thanks
P
Go to Top of Page
   

- Advertisement -