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
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