all groups > sql server reporting services > may 2005 >
You're in the

sql server reporting services

group:

conditonal counting



Re: conditonal counting Wayne Snyder
5/3/2005 12:00:00 AM
sql server reporting services: I haven't tried this but maybe

Sum(iif(Fields!CustomerStatus.Value="Active",1,0))

Otherwise create a computed column with the IIF,
then SUm( the computed column)

(You might also be able to use Excel's sumif function directly>)

--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)

I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
[quoted text, click to view]

conditonal counting jimmy
5/3/2005 12:18:41 PM

is there a way to have conditional counts or conditional running values?
such as counting the number of active customers verses the total number of
customers...

IIF(Fields!CustomerStatus.Value = "Active", Count(Fields!CustomerID.Value),
Nothing)

OR

IIF(Fields!CustomerStatus.Value = "Active",
RunningValue(Fields!CustomerID.Value, Count, Nothing), Nothing)


thanks,
Re: conditonal counting jimmy
5/3/2005 2:07:20 PM

worked perfectly, thanks!



[quoted text, click to view]
AddThis Social Bookmark Button