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

90th Percentile excluding null values 1

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I'm using Crystal 8.5 reporting from an SQL database. The database is hospital emergency department visits.

I have a report that is summarized on visit date showing various data elements i.e. total number of visits, total number of patient left without being seen etc.

Another required metric is ER length of stay at the 90th percentile. I know how to do this but the issue is that I want it to only calculate for cases where there is a valid length of stay. Because this report has all cases, it may not include the case in the LOS calculation but the zero value will be included in the 90th percentile.

So what I've had to do is create a subreport with only valid ER LOS cases and calculate the 90th percentile in that and link to the main report.

BUT is there any way I could do this in the main report because it is causing issues with speed of the report because I have 3 such subreports for 90th percentile.

Thanks.


 
This seems to work correctly. Create a formula {@null} by opening and closing a new formula without entering anything. Then create a formula for your field {@LOS} that contains zeros:

//{@LOSnozeros}:
If {@LOS} = 0 then
tonumber({@null}) else
{@LOS}

Then create a formula {@pth90}:

pthpercentile(90,{@LOSnozeros},{table.groupfield})

-LB
 
Hi LB

Sorry for the late thanks but I only got to try this out today....and it works!! You are a genius - thanks so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top