LaPhi
LaPhi

Reputation: 5907

Report Builder Expression - Count Items

I want to build a report for a SharePoint 2010 list with the Microsoft Report Builder.

Everything works fine with one exception :-(

To count all elements works fine with the following expression:

=Count(Fields!Status.Value, "DataSetDocLib")

But how can I count the items with a specific name?

I tried lots expressions but nothing works. For example I want to count only the items with the name "Running":

=CountDistinct((Fields!Status.Value, "DataSetDocLib"), "Running" ,Recursive)
=Count(Fields!Status.Value Like "Status", "DataSetDocLib")
=CountDistinct(Fields!Status.Value, "Running" ,Recursive, "DataSetDocLib")

It is possible and what´s the correct syntax?

Thank you in advance!

Upvotes: 1

Views: 3288

Answers (2)

user3219693
user3219693

Reputation: 201

I had this issue and was helped in another post if anyone stumbles on to this the answer is at the below link

Report Builder SUM IIF - More than 1 DataSet

I won't put the answer here so credit goes where it is due (Ian Preston)

Upvotes: 1

Neil
Neil

Reputation: 919

I did a small amount of testing and using the following should work:

=SUM(IIF(Fields!Status.Value = "Running", 1, 0)).

Upvotes: 2

Related Questions