MS SQL 2000 Report Services. Conditional Counting
Posted on 2006-07-19
I don't exactly remember how it was called in Crystal Reports (I think it was running totals), but I can't find a similar function in MS Reporting Services. Simple totals are simple, just use Count(...), but if I need to add conditioning, it becomes a real pain as there is nothing I could find so far in Report Services themselves.
Normally, I would create a couple of extra columns in my query, where I'd put 1 and 0 for different conditioning using CASE and then SUM on the proper column, but in this case I've already got 5 extra columns and I'll need 5 more just with 1s and 0s... I will probably have to do it as I did it before, but at least I can try to find how to do it properly.
To summarize: I need to know how to count the number of rows in the set under a condition specified, e.g.:
count( Fields!MyValue.Value ) only where Fields!MhDate = Today() for example.