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

Report on only first record in group

Status
Not open for further replies.

Wishy1

Technical User
May 21, 2010
4
US
Hi everyone,

I'm looking for a little help writing a report. I have a database that looks at inventory and for every change to a product, there is a new line (ie prices change). Therefore there can be multiple lines for the same product. However, all I care about is the first time that product is listed in the database. I have the report grouped by product and I'm trying to figure out how to only display the original price of the product (ie the first time the product was listed in the database) per product and then sum up the prices.

I've found that I can use the "minimum" part of the summary to get the first line per product (I get the minimum ID). However, I'm having trouble getting a summary of each of those minimum product's prices. Does anyone have any ideas? Here's an example:

Product 1 Id: 1 Price:$50
Product 1 Id: 2 Price:$100
Product 2 Id: 3 Price $75
Product 2 Id: 4 Price $30

I can get this:

Product 1 Id: 1 Price:$50
Product 2 Id:3 Price: $75

But can't figure out how to sum up product 1 and product 2.
 
Copy the data from the detail section to the Group Header and suppress the detail section. The Group Header always shows data belonging to the 1st detail row in that group.

hth,
- Ido

view, email, export, burst, distribute, and schedule Crystal Reports.
 
Right. But then I have to add up all the minimums. Is there a good way to do this? Thanks for your help!!
 
But that still doesn't get the total of the price of the min of each inventory.
 
Sorry, didn't notice that part of your question. Create a formula in GH1 that accumulates the minimum values into a global variable.

Then, use a formula in the report footer to display the value of that variable.

- Ido

view, email, export, burst, distribute, and schedule Crystal Reports.
 
Or you could insert a running total that sums the prices and evaluates on change of the product group, reset never--assuming you are sorting in ascending order.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top