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!

Can TopN be used as a Parameter?

Status
Not open for further replies.

lareya

Technical User
Jan 30, 2003
49
US
I would like to use the TopN/bottom N function as a parameter, eg. ?top N = // allows user to chose 1,2,etc.,
and then a ?bottom N also with same choices.

the report should looks like this:
Top ?N (eg 1) Proceduces/Providers

Provider Procedures (this would give their top procedures w/in a date period)
Dr X Lap chole

Dr. Y Knee Arthroscopy


right now I have this:
Provider Procedure
Dr. X Lap Chole
Lap Appy
etc.,

Dr. Y Knee Arthroscopy
Total Hip
etc.,

the parameter called is ?Date which selects a date period.

I hope this makes sense. I just can't seem to get the parameter working for the topN/Bottom N selection.


Thank you in advance,
Lareya


Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
To give you more info regarding this:

Record Selection
{POST_CASE.ENTER_DEPT_DATE} IN {?DATE} and
{POST_CASE.ROOM_GROUP_ID} = "MAIN OR" and //Works fine up to here

NthMostFrequent ({@N DESCRIPTION},POST_PROCEDURE.PROCEDURE_DESC} )
(error: a number is required here (cursor is where I put the asterick. (*{@N DESCRIPTION}

The forumula for @N DESCRIPTION
@N DESCRIPTION
----------------------------------------------------------
Local NumberVar x :={?N NUMBER} ;
(NO ERRORS)

Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
I'm guessing that you could do this by simply creating a formula to establish the rank. If you're currently sorting on the result of a subtotal to establish rank, create a running total or formula to assign a rank within each group. Then, add group selection criteria to limit the rankings to only be less than or equal to the parameter value. Does that make any sense?!?

Peter Shirley
 
Okay,
Yes I am currently sorting on the result of the procedures subtotaled by provider. So I create a formula that will take up to the top 5 of procedures and the bottom 5 of procedures?, then I hide the detail, and then show it with a parameter & selection field that ranks them? more than or less thans?

Will this allow me to have the user be able to select in a parameter field top or bottom, and then a number?

I'm feeling a bit over my head here.

Lareya








++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top