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!

Array of variables

Status
Not open for further replies.

kbrown73

MIS
Sep 9, 2004
32
US
I am working in CR 8.5 to an OpenIngres Database.

I am getting results from 18 categories and need to find the top 5 based on count. Example:

Reason Count VariableName
Scuff 10 ShScuff
Assembly 25 ShAssembly
Color 0 ShColor
Dirty 2 ShDirty
Flash 12 ShFlash
Sinks 4 ShSinks
....
....
....

Reason and Counts are in two fields, I am getting them into their respective variables and summing them within a group.

In the group footer I need to display the top 5 of the 18 reasons with the count totals. Should I put the counts into an array(18) based on specific indexes? Is there a formula to extract the top 5 and return the index location then compare to the predefined index? Or is there an easier way?

Thanks.
 
What are you grouped on?

There is a TOP N built into Crystal, check under the Report pull down, I can't recall what it's called in CR 8.5

-k
 
I am grouped on Two different fields. See below

Group1 - Press Name
Group2 - Shift
Details: Job GrossPieces RejectReason RejectCount

I am pulling from two different tables. The scrap information (Reason and Count) are in a separate table from the Job info. I may be pulling 20-30 shifts per press.
 
Why are you using variables to get the counts? Couldn't you insert a third group on reason and insert a count on some recurring field? Then you would go to report->topN/group sort, choose the reason group, and select topN = 5 and choose count of the recurring field.

If there is some reason you feel you need to use variables, then you should share the contents of your variable formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top