Actually, I have an understanding of how PERCENTILE_CONT works, but I get a different result by calculating percentiles manually and calling the function. Here is the dataset:
305.7884804
350
373.3728865
384.2094838
410.8603441
414.9842786
455.3545205
550
To calculate 25%, summarize 350and 373.3728865, and then divide it by 2. And the result 361.68644325.
To calculate 50%, summarize 384.2094838and 410.8603441, and then divide it by 2. And the result 397.53491395.
To calculate 75%, summarize 414.9842786and 455.3545205, and then divide it by 2. And the result 435.16939955.
However, when I run this sql:
select
percentile_cont(0.25) within group(order by YEAR_2_FTE ASC),
percentile_cont(0.5) within group(order by YEAR_2_FTE ASC),
percentile_cont(0.75) within group(order by YEAR_2_FTE ASC) from sr_database
where firm_id=999;
I get this result:
25%: 367.529664875
50%: 397.53491395
75%: 425.076839075
?