Selecting by group total
I am just starting to use RB. I want a report that groups records together
by a key field, adding up values from another field in each record to get a
group total of that field, and then print the records and group total line
ONLY from the groups whose group total exceeds a specific value. Can I do
this type of record selection with RB?
thanks
Whit Cox
by a key field, adding up values from another field in each record to get a
group total of that field, and then print the records and group total line
ONLY from the groups whose group total exceeds a specific value. Can I do
this type of record selection with RB?
thanks
Whit Cox
This discussion has been closed.
Comments
The easiest way to go about this would be to perform all the data gathering
in SQL using the HAVING clause. Create a query similar to the following.
SELECT SUM(MyValueField)
FROM MyTable
GROUPBY MyKeyField
HAVING SUM(MyValueField) > X
With the above query, you would simply place a DBText inside the detail band
and link it to the sum field to display the data you need.
If you are using DADE (data workspace in ReportBuilder) you can create a
query similar to the one above completely inside ReportBuilder. See the
following article.
http://www.digital-metaphors.com:8080/DADE/Fundamentals/Group_Search_(Having_Clause)_Fundamentals
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com