Management Technology Services Inc.

The Current R&R Hot Tip

"Selective Counting" of records in your report....

Have you ever had to create report which displays a list of records from your database, but you want a record count that reflects only a subset of records listed? It's a fairly common reporting requirement, and is easily handled by R&R ReportWriter, once you know how to do it.

Let's use this example: You are asked to build a report that lists all of your customers in alphabetical order, showing the balance owed by each customer, and a total owed by all customers at the end of the report. Finally, next to the grand total, you need to show the boss a count of the number of clients with balances greater than $10,000. No problem.

The trick is to use the "Condition" option for the Total field that you create as your Count of the records. Go ahead and build your report, including the Total field specified as a "Count" resetting at "Grand" so that you get a count of all of the records on the report. Now to limit the count to only those records where the balance is greater than $10,000, go to the options for your total field and set a conditional expression something like this: [BalanceOwedField]>10000

Now the count will reflect exactly what you want. By the way, if you're still using an older version of R&R ReportWriter that does not offer the "conditional" option for total fields, you can still do this. In that case, create a calculated field with an expression that uses the IIF() function like this: IIF([BalanceOwedField]>10000,1,0)

Then create your total field to simply Sum this calculated field you just created. It adds up the 0's and 1's to give you a true count of the records that met your condition. Happy Reporting!

Have you got a question related to creating R&R reports that you'd like to see an answer for in a future "Hot Tip"? If so, send it to us, and we'll consider responding to it in a future "Hot Tip"!

BACK

Home ·   Periculum Services Group ·   R&R Report Writer ·  Welcome To Town

 About MTS ·  Contact MTS ·  E-Learning Products

Copyright, 2002.
Management Technology Services, Inc.