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

Group Sort of Data

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
I have a formula for turnover time (TOT) which I have placed in a report. The formula works fine and is as follows:

If onfirstrecord then 0 else
IF {pcmORroom.orName} = PREVIOUS ({pcmORroom.orName})
THEN ({@PatientINRoom} - PREVIOUS ({@PatientOutRoom}))/60

I am presently sorting the report by “Surgical Date” and then “orName” and then “Patient INRoom” order.

The group sort is important for deriving the TOT and I understand I can’t mess with that order. However, as a secondary report, I need to also sort all the output in ascending TOT order. I have done this, for now, by exporting the data to Excel and sorting on the TOT column.

Any possibility to have the TOT sorted (in ascending order) in another section of the report?
That is, one section would have data as (I have this part done already):
02/01/2007 AS 1 0.00
02/01/2007 AS 1 34.00
02/01/2007 AS 1 36.00
02/01/2007 AS 1 44.00
02/01/2007 AS 1 34.00
02/01/2007 AS 2 0.00
02/01/2007 AS 2 45.00
02/01/2007 AS 2 43.00
Another section would have data as:
02/01/2007 AS 1 0.00
02/01/2007 AS 2 0.00
02/01/2007 AS 1 34.00
02/01/2007 AS 1 34.00
02/01/2007 AS 1 36.00
02/01/2007 AS 2 43.00
02/01/2007 AS 1 44.00

I am using Crystal 10.0.
 
Use Save As to make a copy of the report. Re-import it as a subreport in the header or footer. Put the subreport in the "TOT order".

This will of course double the amount of machine-time the report uses, subreports are expensive. But I can't see any other way to do it. Crosstabs are useful in some cases but don't seen to apply here.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I have placed the subreport in my report footer and all the data is there.

I can't find a way, yet, to sort on the "TOT field (other than exporting it to Excel) perhaps because it is a formula?

How do I sort the subreport in TOT ascending or descending manner so that I may report on number of cases with turnaround time of less than 10 minutes, or less than 20 minutes, etc. I played with the Group Expert, without success.
 
You will not be able to sort by any formula that contains the previous() function, since it requires a comparison between records, based on their sequence.

-LB
 
Thank you for validating that, LB. Much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top