Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximum of shared variable from subreport

Status
Not open for further replies.

BizzyLizzy

Technical User
Nov 3, 2003
77
AU
Hi people

I am using CR8.5 with ODBC connection to SQL database.

In my main report I have a field showing highest number of SMS's sent. This has been pulled from a subreport that works out the highest number sent in any one hour during a day! (not sure that makes sense so here's the formula!)

whileprintingrecords;

shared numbervar busy:=Sum ({@MESSAGE},{CC_OPTUS.CREATED}, "by hour")

This subreport is then sorted using a TOPN (where N is 1) - so the end result is that I get the number of SMS's sent during the busiest hour of the day!.

This is then pulled into the main report - this works fine!

The problem I am now having is that the main report is a daily summary report grouped by month with an overall running total for the month on all fields - except the Busy Hour sent field.

What I would like to do would be to show the ‘maximum’ of the shared variable 'busy' and I cannot figure a way to do it. I keep running up against the ‘The summary/running total could not be created’ error.

Hope that someone out there can help!
 
If you can display the maximum in the month group footer, then you should be able to use a formula like the following (to be placed in the daily group):

whileprintingrecords;
shared numbervar busy;
numbervar maxbusy;

if maxbusy < busy then
maxbusy := busy;
maxbusy;

Then in the monthly group footer, place the formula:

whileprintingrecords;
numbervar maxbusy;

-LB
 
So simple! Now why didnt I think of that.

Thank you so much.

Lizzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top