1

I'm looking to bring in my expression 2 values that I what to add together.

=Sum(iif(Fields!Leadsource.Value = "set1", 1, 0) and (Fields!Leadsource.Value = "set", 1, 0))

but is just coming back as 0 when the value should be 400 or so.

Can any one point me in the right direction?

Pedram
  • 6,256
  • 10
  • 65
  • 87

1 Answers1

1

I'm not sure how SSRS evaluates your expression

=Sum(iif(Fields!Leadsource.Value = "set1", 1, 0) and (Fields!Leadsource.Value = "set", 1, 0))

I think SUM(1 AND 0) and SUM(1 AND 1) both equal 1.

Your expression needs to be changed a little - though I'm not sure which you need.

=Sum(IIF(Fields!Leadsource.Value = "set1" OR Fields!Leadsource.Value = "set", 1, 0))

Otherwise if you want to count the two different criteria separately, use:

=Sum(IIF(Fields!Leadsource.Value = "set1", 1, 0) + (Fields!Leadsource.Value = "set", 1, 0))
Hannover Fist
  • 10,393
  • 1
  • 18
  • 39
  • Now that I look at it again, you use the same field in your comparison so it should be an OR not AND. I updated my answer. – Hannover Fist Dec 16 '15 at 22:36