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

Crystal report PthPercentile and Oracle Percentile

Status
Not open for further replies.

JeanneZ

Programmer
May 1, 2003
55
0
0
US
Hi Crystal expert,
I need help. I used PthPercentile in Crystal report but got different result vs Oracle percentile function.
For example:
Our data like
dept num
1 0.1069
2 0.1182
3 0.0658
4 0.1045
I would like to find 33% low and 66% high values.
But Crystal returns 0.085 low and 0.1126 high when I used PthPercentile function:
low := PthPercentile (33, {@%num});
high := PthPercentile (66, {@%num});
And Oracle SQL returns 0.1045 low and 0.1069 high when I used percentile function:
Percentile_DISC(0.33) WITHIN GROUP(ORDER BY num ASC) OVER (PARTITION BY dept) low,
Percentile_DISC(0.66) WITHIN GROUP(ORDER BY num ASC) OVER (PARTITION BY dept) high
Please help me to have right Oracle SQL to match the Crystal result.
Thanks a lot for any help.
Jeanne

 
What is the content of {@%num}? Do you have any other groups besides a group on dept?

-LB
 
No, that's only group. The content of number is from the table num field.
Thanks.
 
Please show the actual formula content.

-LB
 
The following thread might be helpful: thread782-1436244.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top