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

Maximum Value of a count

Status
Not open for further replies.

muddy1

Technical User
Jan 27, 2004
14
AU
Is there any way to summarize information in this way. I have different tests {Test.TestName} and test costs {Test.TestCost} in a laboratory database. What I want to do is show each test once, count the number of times it appears under a client request, take the maximum (no of units) and invoice out to the client.
Can anyone think of a way to do it? There are over 300 tests so I don't want to have to go and group by each individual value. Is there another way around?

Thanks,

Jenny.
 
A bit unclear to me.

Providing the following generally helps:

Crystal version
Database/connectivity used
Example data
Expected output

What is a client request "count the number of times it appears under a client request"?

I'll assume that you want to group by the Client, then by the test.

You can display summaries in the data in the Group Footer of the Test grouping. To create a summary, drop a field into the details, right click it and select insert->summary and choose the type of summary and for which groups and you cqan also select grand totals in some versions at that point.

I'm not sure what "take the maximum (no of units)", you didn't say anything in the field descriptions about a number of units field nor what it is.

You want the maximum...so you only invoice for the test which was done the most times, or do you mean you want the sum?

Examples would be more helpful than trying to provide a description.

-k
 
Thanks for your quick reply..
I am using CR 9 to link to an access database.
I have a customer request. Within that request they may may have a number of samples to have tests performed on. I want to raise an invoice based on an assigned cost to each of the tests performed on each of the samples, within a particular request. I am currently using the selection expert to find all samples / tests within a specified request. To raise the invoice, I need to count the number of times a particular test {Test.TestName} appears under a specific request number, then multiply it by its "unit cost" ie {Test.CostPerTest}. The rest of the summing, I have worked out.

eg So for a request with 4 samples needing density testing and 2 needing viscosity testing, I need to produce the following...

TestName CostPerTest Count TotalPerTest
Viscosity $90 2 $180
Density $120 4 $480

I hope this helps..

Jenny.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top