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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert summary on a group header value

Status
Not open for further replies.

SimonPetherick

Technical User
Sep 25, 2002
49
AU
Hi,
I have a basic report where the 'details' section contains 10 minutely data (this section is supressed). I have inserted a group header that groups it into daily data. What I need to do is display the 'maximum' daily figure over the period. Is this possible using Crystal 8.5? Ideally I'd like to 'insert summary' (max) against the grouped daily figure but it won't let me.
Thanks,
SP
 
What is the data you want to find max of, max summary will only work with date or number fields.

If you have a number expressed as text try using a formula to convert to anumber and then max that
tonumber(fieldname)

However, this formula will fall over if it encounters a non numeric string.

Ian Waterman
UK Crystal Consultant
 
You should be able to do a TopN on the daily summary by going to report->TopN. This will sort the daily groups in descending order by amount. If you only want to display the highest one then choose N = 1.

-LB
 
Ian - I am trying to put the daily 'max' into either the Page Header or Report Header. Unfortunately your solution didn't work. The daily figures are already a sum of the details section, hence it won't let me perform another summary (ie max).

lbass - Whilst you soultion works, I still need to list all the daily totals, and have the maximum of these totals placed in the Page Header or Report Header.

Thanx.

SP
 
You have at least two options. First, if you don't care about the order of the daily groups, do the TopN for "All" in descending order, and then place the following formula in the report header (this doesn't work in the page header after page 1, since the formula takes on the value of the first group on the page):

sum({table.amount},{table.date})

If you want the daily groups to proceed in order, then create an unlinked subreport with the fields necessary to calculate the maximum amount. Create the same grouping, insert a sum on the amount, and do a TopN (descending) on the sum. Then suppress all subreport sections except the group footer where the sum is. Then, within the subreport, go to format section->group footer->suppress->x+2 and enter:

groupnumber <> 1

You now have the maximum value available in the subreport. Place the subreport in the group header or in the page header, as you wish.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top