Results 1 to 4 of 4
  1. #1
    vishal09 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    3

    Deciling in Access

    Hi,



    I have a dataset with around 3.1 Million records with Sales information of different Physicians. I want to calculate decile of Physicians based on their Sales data. Is there any way to calculate decile in Access.
    Also keeping in mind that the recordset is huge. Thanks in advance!

  2. #2
    DubCap01 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Location
    Dubbo, Australia
    Posts
    104
    Hi Vishal09

    try taking a subset ( maybe one millionth of your records lol) and create another database to try your theory?

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you'll need a query for each decile

    the principle would be to

    get your first decile

    SELECT Top 10% *
    FROM tblSales
    ORDER BY SalesValue

    to get the second

    SELECT Top 20% *
    FROM tblSales LEFT JOIN (SELECT Top 10% * FROM tblSales ORDER BY SalesValue) AS P ON tblSales.ID=P.ID
    WHERE P.ID is null


    to get the third

    SELECT Top 30% *
    FROM tblSales LEFT JOIN (SELECT Top 20% * FROM tblSales ORDER BY SalesValue) AS P ON tblSales.ID=P.ID
    WHERE P.ID is null

    etc

    to get the last

    SELECT *
    FROM tblSales LEFT JOIN (SELECT Top 90% * FROM tblSales ORDER BY SalesValue) AS P ON tblSales.ID=P.ID
    WHERE P.ID is null

    ID needs to be a field with a value unique to each row

    As DubCap says, suggest take a small set of data to test the principle. Also ensure your data is properly indexed, it will make a huge difference to the speed the query runs. In the above example you would index ID and SalesValue

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There have been several threads on quintiles/quartiles/percentiles. Search forum on those keywords. Further filter with my username. Should get at least 4. Here is one https://www.accessforums.net/access/...74/index3.html
    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.

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