Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 09 Sep 2010 @ 10:07:56 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Excluding Top and Bottom 5 % of records
 
From:   Dieter Noeth

  I am looking at the most efficient method to exclude the top 5% and bottom 5% of records.  


Instead of quantile (which is non-Standard and therefore deprecated) better use percent_rank, which is quite similar to your calculation:

     qualify percent_rank()
        over (Partition by Team Order By Results desc)
        between 0.05 and 0.95

There's a slight difference between quantile and percent_rank, quantile is based on:

     (rank - 1) / count" vs. "(rank - 1) / (count - 1)

Dieter



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023