Results 1 to 2 of 2
  1. #1
    akira is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    8

    Filter out Bottom 5% and Top 5% Percentile

    Hi all,

    Just wondering if it's possible to filter out the bottom and top 5% of a value in a table. For example,

    Group Value
    A 1111
    A 223
    A 423


    A 241
    A 142
    A 132
    A 1
    B
    .
    .
    .

    As you can see in the dummy data, Value 1111 and value 1 are the outliers which may affect my future calculations. Is there any way that when I set up my query, it will filter those outliers out?

    Thanks,
    akira

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    This requires calculating 95 and 5 percentiles and then filter records with values outside that range. Never done this and research indicates not easy. Review:
    http://access.mvps.org/access/queries/qry0019.htm
    http://www.fmsinc.com/MicrosoftAcces...s/percentiles/

    This offered hope for a simple query solution but never quite resolved:
    http://www.dbforums.com/microsoft-ac...lculation.html

    Then I find this:
    http://blogannath.blogspot.com/2010/...entile_25.html

    And tested this:
    SELECT Group, [Value]
    FROM Pct95 RIGHT JOIN (Table1 LEFT JOIN Pct5 ON Table1.[Amount] = Pct5.[Amount]) ON Pct95.Amount = Table1.Amount
    WHERE (((Pct5.Amount) Is Null) AND ((Pct95.Amount) Is Null));

    There is only one record in each of the 5 and 95 percentiles and don't think would work if there were more.

    So tried this which looks like best I can do:
    SELECT Group, [Value]
    FROM Table1
    WHERE Table1.[Value] Not IN(SELECT TOP 5 PERCENT Table1.[Value] FROM Table1 ORDER BY Table1.[Value])
    AND Table1.[Value] Not IN(SELECT TOP 5 PERCENT Table1.[Value] FROM Table1 ORDER BY Table1.[Value] DESC);

    BTW, Value is a reserved word and should not use reserved words as names. Amount or Quantity would be better.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. how to do 75th percentile for a query field
    By vicki58 in forum Queries
    Replies: 3
    Last Post: 12-20-2013, 09:27 AM
  2. Remove Navigation from bottom of tables
    By bob500000 in forum Access
    Replies: 10
    Last Post: 12-05-2011, 11:37 PM
  3. Open form and locate it on the bottom
    By Dominaz in forum Forms
    Replies: 4
    Last Post: 11-17-2011, 08:03 PM
  4. can't update form-in the bottom bar of
    By ymds in forum Access
    Replies: 2
    Last Post: 07-19-2010, 06:26 AM
  5. Moving from Top of report to bottom
    By BrianFawcett in forum Programming
    Replies: 0
    Last Post: 05-05-2010, 09:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums