Skip to main content
added 561 characters in body
Source Link
Ian Preston
  • 39.8k
  • 9
  • 98
  • 94

OK, it seems like all you need is the following expression:

=Sum(IIf(Fields!Logged30Days.Value = "yes", 1, 0) 

All this is doing is counting the rows with a yes value for Logged30Days; it the value is not yes it's just ignored for the count.

In your case,

=IIF(Fields!Logged30Days.Value = "yes", Count(Fields!Logged30Days.Value),0) 

is the same as:

=IIF(First(Fields!Logged30Days.Value) = "yes", Count(Fields!Logged30Days.Value),0) 

i.e. when there is more than one row in the Scope but no aggregate specified it will just take the first row. So the expression was determined by the first row's value only. Also, when the first value was yes the Count would count all rows, even those where the value was not yes, which was also not quite what you were after either, I think.

OK, it seems like all you need is the following expression:

=Sum(IIf(Fields!Logged30Days.Value = "yes", 1, 0) 

All this is doing is counting the rows with a yes value for Logged30Days; it the value is not yes it's just ignored for the count.

OK, it seems like all you need is the following expression:

=Sum(IIf(Fields!Logged30Days.Value = "yes", 1, 0) 

All this is doing is counting the rows with a yes value for Logged30Days; it the value is not yes it's just ignored for the count.

In your case,

=IIF(Fields!Logged30Days.Value = "yes", Count(Fields!Logged30Days.Value),0) 

is the same as:

=IIF(First(Fields!Logged30Days.Value) = "yes", Count(Fields!Logged30Days.Value),0) 

i.e. when there is more than one row in the Scope but no aggregate specified it will just take the first row. So the expression was determined by the first row's value only. Also, when the first value was yes the Count would count all rows, even those where the value was not yes, which was also not quite what you were after either, I think.

Source Link
Ian Preston
  • 39.8k
  • 9
  • 98
  • 94

OK, it seems like all you need is the following expression:

=Sum(IIf(Fields!Logged30Days.Value = "yes", 1, 0) 

All this is doing is counting the rows with a yes value for Logged30Days; it the value is not yes it's just ignored for the count.