Results 1 to 3 of 3
  1. #1
    j235 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Posts
    3

    Calculating decile in Access

    Hi,
    I have one problem with calculation decile in Access. Namely I want to calculate 10 th,20 th,30 th,40th,50th,60th,70th,80th,90th and 100th decile for numbers in columns c1 and c2 in Table.
    I have SQL code for Access, but with this code I can calculate only one value for decile (For example with code below I can calculate decile only for 50th percent and for one column “c1”, but I ‘cant calculate for all 10 category of decile for two columns C1 and C2).
    Can anybody help me with this issue?
    Thank you in advance.

    SQL CODE
    SELECT Max([C1]) AS Percentile
    FROM
    (SELECT TOP 50 PERCENT [C1]


    FROM [Tabele]
    ORDER BY [C1] ASC);

    Table
    c1 c2
    1 252
    2 525
    5 21
    10 25
    150 2665
    15812 2511
    1515 2515
    1518 325
    1548 2515
    1588 25
    1288 58
    12558 98
    1555 596

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What exactly have you tried? What specifically was the result of each attempt?
    What is the issue currently?

    Did you consider a loop construct?

    -you have 2 field names
    -you have 10 deciles

    eg psuedo code
    Code:
    For field1 to field2
         For decile 1 to 10
               construct  and run your sql 
           SELECT Max([field]) AS Percentile
           FROM 
           (SELECT TOP decile * 10 PERCENT [field]
           FROM [Table]
           ORDER BY [field] ASC);
         print the values of field and decile
         Next decile
    Next field
    Also, when you cross post tell the readers you have done so and provide a link

    cross posted http://www.access-programmers.co.uk/...d.php?t=285149
    and http://www.utteraccess.com/forum/ind...wtopic=2035397

  3. #3
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423

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

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2015, 08:03 PM
  2. Calculating distance in access?
    By CarolR in forum Access
    Replies: 2
    Last Post: 05-04-2014, 10:29 AM
  3. Calculating Percentiles in Access
    By maliotta in forum Access
    Replies: 4
    Last Post: 03-13-2014, 03:28 PM
  4. Replies: 4
    Last Post: 12-16-2010, 05:29 AM
  5. calculating due dates in access
    By trixxnixon in forum Forms
    Replies: 0
    Last Post: 09-28-2008, 12:35 PM

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