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

Maximum of a Maximum - CR 8.5 1

Status
Not open for further replies.

SFBus

Technical User
Jun 21, 2001
8
AU
Hello there,

I hope someone can help with the issue I am having here. The report template is in Crystal Reports 8.5, with it accessing info via ODBC to a SQL database. The info being retrieved is from a inventory system basically.

This is the current report layout:

GH1 : Grouped by Product Code (Hidden)
GH2 : Grouped by Date Going Out (Hidden)

Detail Section (Hidden) : Booking Number, Product Code, Qty on Booking

Sample Data:

GH1 : Q1 (Product Code)

GH2 : Day A
Detail : ABC01, Q1, 5
Detail : DEF02, Q1, 8
Detail : DEF03, Q1, 2
GF2 : Day A : Sum of Qty Used = 15

GH2 : Day B
Detail : ABC01, Q1, 2
Detail : DEF02, Q1, 7
GF2 : Day B: Sum of Qty Used = 9

GH2 : Day C
Detail : ABC01, Q1, 1
Detail : DEF02, Q1, 3
Detail : DEF03, Q1, 5
GF2 : Day C: Sum of Qty Used = 9

GF1 : Product Code, Max. Used on any Day

-------------------------------------------

GF2 : Running Total of Qty of Product across all the Bookings on that day. This then gives us the sum used on any given day for the month. Resets on change of GF2. From the sample data above, I get a number in here of '15' for Day A, 9 for Day B and 9 for Day C, which is correct for each day.

GF1 : Now I need the Maximum Qty used on any given day for the Month? So I now need the Maximum of the Running Total at GF2? I need to see that the maximum number of product Q1 used on any day was '15'.

Everything will be hidden but GF1 on the final report template.

Any help greatly appreciated.

Thank you.

 
You could do the following.

In GH1, place formula

//@Max_Init
shared numbervar maxtot := 0;


In GF2, place 2nd formula

//@Max_check
shared numbervar maxtot;
if sum_of_qty_used > maxtot then
maxtot := sum_of_qty_used
else
maxtot := maxtot


In GF1, place 3rd formula to display

//@max_show
shared numbervar maxtot

maxtot


-lw
 

Thank you !! this has worked perfectly ..

:) :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top