I have a report, for which I want to do a conditional count. The table is something like this:
ID Date Description
1 30-09-2000 10:36:06 Desc1
2 15-03-2000 11:45:11 Desc2
3 12-07-2005 16:21:10 Desc3
4 10-09-2006 11:12:18 Desc4
(...)
I want to count only the entries where the Date field has the value 2000.
The expressiona that I am using is the following one:
=Sum(IIF(Fields!Date.Value.ToString().Contains("2000"),1,0))
It is giving me the right value but my problem is that the value apears repeated. Something like:
CountResult
2
2
2
(...)
What I want to have is just one value of the conditional count.
Has anyone passed by something like this? Any solutions?
Thanks and best regards
vjn
By the look of the layout, you are using a table. In the details cell don't use the Sum() function you only put this in the group/table footer to give you the subtotal. So if my understaning is correct:
Details cell expression: =IIF(Fields!Date.Value.ToString().Contains("2000"),1,0)
Footer cell expression : =Sum(IIF(Fields!Date.Value.ToString().Contains("2000"),1,0))
ID Date Description CountResult
===================================================
1 30-09-2000 10:36:06 Desc1 1
2 15-03-2000 11:45:11 Desc2 1
3 12-07-2005 16:21:10 Desc3 0
4 10-09-2006 11:12:18 Desc4 0
===================================================
TOTAL 2
Thank you Adam.
Best regards
vjn
No comments:
Post a Comment