NewbieSQL_Germany
NewbieSQL_Germany

Reputation: 85

SSRS Count = 0 / Count >0 Expression

I'm building a report in SSRS that shows achieved bonuses for each employee. I have added an additional column that multiplies the different factors to calculate the final bonus.

Now I need to add more columns, one that only shows the number of employees, that have achieved zero bonus in the totals-row and another column, that only shows the number of employees whom achieved bonus in the totals-row.

My expression to get the final bonus is:

=Fields!Faktor1.Value * Fields!Faktor2.Value * Fields!Faktor3.Value * Fields!Faktor4.Value

I've tried something like:

=COUNT(IIF(Fields!Faktor1.Value * Fields!Faktor2.Value * Fields!Faktor3.Value * Fields!Faktor4.Value)= 0,(Fields!Faktor1.Value * Fields!Faktor2.Value * Fields!Faktor3.Value * Fields!Faktor4.Value),NOTHING)

But that didn't work.

Thanks in advance for your help.

Upvotes: 0

Views: 156

Answers (1)

Hannover Fist
Hannover Fist

Reputation: 10880

I think you can use a SUM with a one or zero instead of COUNT with your expression to make it work:

=SUM(IIF(Fields!Faktor1.Value * Fields!Faktor2.Value * Fields!Faktor3.Value * Fields!Faktor4.Value) = 0, 1, 0)

Upvotes: 1

Related Questions