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 2005 Forums
 Analysis Server and Reporting Services (2005)
 Count and filters

Author  Topic 

CASHMOREGF
Starting Member

2 Posts

Posted - 2009-03-13 : 11:10:24
I want to count on a field where the valude of this field = "2"
When I run below, I correctly get a full count of all returned values of the field in the query.

=count(Fields!Audit_ID.Value)

So for this I may get 100 as a return. I have 100 rows of data. How can I filter and return only the rows that are equal to 2 ? Maybe I would only get 50.

Believe me when i tell you I have tried multiple variations of distinctcount, filter etc.

ie:=count(filter(Fields!Status_id.value, "2", True, 2))
Gets me 'Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope'

ie:=countdistinct(filter(Fields!Status_ID.Value, "2", True))
gets me Argument matching parameter 'Source' cannot convert from 'Integer' to 'String()'.
'Public Shared Function Filter(Source As System.Object(), Match As String, [Include As Boolean = True], [Compare As Microsoft.VisualBasic.CompareMethod = Binary]) As String()':
Argument matching parameter 'Source' cannot convert from 'Integer' to 'Object()'.

They all come back with errors.
Any ideas on how to do this?

thanks in advance

CASHMOREGF
Starting Member

2 Posts

Posted - 2009-03-13 : 12:28:46
OK, I found this, but still need some help!!
=cstr(sum(IIF(Fields!Status_Desc.Value="Closed",1,0)))

This worked. Now I added another dataset and I'm back to the same stuff.
The other dataset named is GVLSNT025YTD vs GVLSNT025Monthly
What is the format to add in the dataset for this string??


Thanks in advance

Go to Top of Page
   

- Advertisement -