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

Use of top N sort 1

Status
Not open for further replies.

whimple

Programmer
Mar 31, 2002
7
0
0
US
I am working on a report to show the n most used diagnoses in a medical clinic. I need to show the n most used diagnoses for a given reason for visit (RFV). The RFV for each visit is in one table, and the diagnoses used for each visit are in another table, linked by a unique visit ID number. Each visit will have one RFV, but may have several diagnoses used. I am thinking that the top N sort would be appropriate, but I am having trouble applying it to this situation (newbie that I am). Any ideas on how to approach this, whether by top n sort or any other method?
Thanks in advance to anyone who replies!
 
TopN is what you want.
1) Group by Reason
2) Group by Diagnosis within Reason.
3) Add a summary that counts the visits by Reason
4) Add a summary that counts the visits by Diagnosis within Reason.
5) Then do a TopN of the Diagnosis count. You can set N to be any number, and it will only show the TopN within each RFV. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top