How do I do a count using a sum?

From SmartWiki
Revision as of 10:01, 26 April 2013 by Arthur Lathrop (talk | contribs)

Jump to: navigation, search

Q: How do I do a count using a sum?

A: if([this]='Counting Criteria',1,0)

Why do we do this?

When using the Criteria line in the Report Builder, one line of criteria is treated as a single AND statement. By using this method we can move the criteria up to the Calculate Field area and allow for multiple OR criteria using a singular AND statement in the Criteria line.

Examples

ReportBuilderExample1.PNG This calculation will assign a value of "1" to each record where the @userid@ matches the Owner ID (in other words, all records where the user currently logged in is the Owner of the record), and a value of "0" to all other records, and then sum up the list.